Changeset 2f08a55d in mainline for arch/amd64/src/fmath.c
- Timestamp:
- 2005-09-03T14:16:25Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f6297e0
- Parents:
- 544b4bf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/src/fmath.c
r544b4bf r2f08a55d 32 32 //TODO: 33 33 #define FMATH_MANTISA_MASK ( 0x000fffffffffffffLL ) 34 35 int fmath_is_negative(double num)36 { //TODO:37 /* fmath_ld_union_t fmath_ld_union;38 fmath_ld_union.bf = num;39 return ((fmath_ld_union.ldd[7])&0x80)==0x80; //first bit is sign, IA32 is little endian -> 8th byte40 */41 return 0;42 }43 34 44 35 signed short fmath_get_binary_exponent(double num) … … 117 108 }; 118 109 119 double fmath_set_sign(double num,__u8 sign)120 { //TODO:121 /* fmath_ld_union_t fmath_ld_union;122 fmath_ld_union.bf = num;123 fmath_ld_union.ldd[7]=((fmath_ld_union.ldd[7])&0x7f)|(sign<<7); // change 64th bit (IA32 is a little endian)124 return fmath_ld_union.bf;125 */ return 1.0;126 }127 128 double fmath_abs(double num)129 { //TODO:130 /*131 return fmath_set_sign(num,0);132 */133 return 1.0;134 }135 110 136 111 double fmath_dpow(double base, double exponent) … … 158 133 } 159 134 135 136 int fmath_is_nan(double num) 137 { 138 /* __u16 exp; 139 fmath_ld_union_t fmath_ld_union; 140 fmath_ld_union.bf = num; 141 exp=(((fmath_ld_union.ldd[7])&0x7f)<<4) + (((fmath_ld_union.ldd[6])&0xf0)>>4); // exponent is 11 bits lenght, so sevent bits is in 8th byte and 4 bits in 7th 142 143 if (exp!=0x07ff) return 0; 144 if (fmath_get_binary_mantisa(num)>=FMATH_NAN) return 1; 145 146 */ 147 return 0; 148 } 149 150 int fmath_is_infinity(double num) 151 { 152 /* __u16 exp; 153 fmath_ld_union_t fmath_ld_union; 154 fmath_ld_union.bf = num; 155 exp=(((fmath_ld_union.ldd[7])&0x7f)<<4) + (((fmath_ld_union.ldd[6])&0xf0)>>4); // exponent is 11 bits lenght, so sevent bits is in 8th byte and 4 bits in 7th 156 157 if (exp!=0x07ff) return 0; 158 if (fmath_get_binary_mantisa(num)==0x0) return 1; 159 */ return 0; 160 } 161
Note:
See TracChangeset
for help on using the changeset viewer.