OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [config/] [floatditf.c] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
/* Public domain.  */
2
#if __LDBL_MANT_DIG__ == 106 || __LDBL_MANT_DIG__ == 113
3
typedef int DItype __attribute__ ((mode (DI)));
4
typedef int SItype __attribute__ ((mode (SI)));
5
typedef unsigned int UDItype __attribute__ ((mode (DI)));
6
typedef unsigned int USItype __attribute__ ((mode (SI)));
7
typedef float DFtype __attribute__ ((mode (DF)));
8
typedef float TFtype __attribute__ ((mode (TF)));
9
 
10
TFtype __floatditf (UDItype);
11
 
12
TFtype
13
__floatditf (UDItype u)
14
{
15
  DFtype dh, dl;
16
 
17
  dh = (SItype) (u >> (sizeof (SItype) * 8));
18
  dh *= 2.0 * (((UDItype) 1) << ((sizeof (SItype) * 8) - 1));
19
  dl = (USItype) (u & ((((UDItype) 1) << (sizeof (SItype) * 8)) - 1));
20
 
21
  return (TFtype) dh + (TFtype) dl;
22
}
23
 
24
#endif
25
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.