Changeset e649dfa in mainline
- Timestamp:
- 2005-12-20T16:29:19Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ef0aa999
- Parents:
- 7e557805
- Location:
- softfloat
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified softfloat/generic/comparison.c ¶
r7e557805 re649dfa 54 54 55 55 /** 56 * @return 1, if a >b - but NaNs are not recognized56 * @return 1, if a<b - but NaNs are not recognized 57 57 */ 58 58 inline int isFloat32lt(float32 a, float32 b) … … 67 67 } 68 68 69 /** 70 * @return 1, if a>b - but NaNs are not recognized 71 */ 72 inline int isFloat32gt(float32 a, float32 b) 73 { 74 if (((a.binary| b.binary)&0x7FFFFFFF)==0) { 75 return 0; 76 }; 77 a.parts.sign^=a.parts.sign; 78 b.parts.sign^=b.parts.sign; 79 return (a.binary>b.binary); 80 81 } 69 82 83 -
TabularUnified softfloat/generic/softfloat.c ¶
r7e557805 re649dfa 137 137 return __eqsf2(a,b); 138 138 }; 139 140 /* return value >= 0 if a>=b and neither is NaN */ 141 int __gesf2(float a, float b) 142 { 143 float32 fa,fb; 144 fa.f=a; 145 fb.f=b; 146 if ((isFloat32NaN(fa))||(isFloat32NaN(fb))) { 147 /* TODO: sigNaNs*/ 148 return 1; 149 }; 150 151 if (isFloat32eq(fa,fb)) { 152 return 0; 153 }; 154 155 if (isFloat32gt(fa,fb)) { 156 return 1; 157 }; 158 159 return -1; 160 } 161 162 /** Return negative value, if a<b and neither is NaN*/ 163 int __ltsf2(float a, float b) 164 { 165 float32 fa,fb; 166 fa.f=a; 167 fb.f=b; 168 if ((isFloat32NaN(fa))||(isFloat32NaN(fb))) { 169 /* TODO: sigNaNs*/ 170 return 1; 171 }; 172 if (isFloat32lt(fa, fb)) { 173 return -1; 174 }; 175 return 0; 176 } 177 178 /* return value <= 0 if a<=b and neither is NaN */ 179 int __lesf2(float a, float b) 180 { 181 float32 fa,fb; 182 fa.f=a; 183 fb.f=b; 184 if ((isFloat32NaN(fa))||(isFloat32NaN(fb))) { 185 /* TODO: sigNaNs*/ 186 return 1; 187 }; 188 189 if (isFloat32eq(fa,fb)) { 190 return 0; 191 }; 192 193 if (isFloat32lt(fa,fb)) { 194 return -1; 195 }; 196 197 return 1; 198 } 199 200 /** Return positive value, if a>b and neither is NaN*/ 201 int __ltsf2(float a, float b) 202 { 203 float32 fa,fb; 204 fa.f=a; 205 fb.f=b; 206 if ((isFloat32NaN(fa))||(isFloat32NaN(fb))) { 207 /* TODO: sigNaNs*/ 208 return 1; 209 }; 210 if (isFloat32gt(fa, fb)) { 211 return 1; 212 }; 213 return 0; 214 } 215 139 216 /* Other functions */ 140 217 -
TabularUnified softfloat/include/comparison.h ¶
r7e557805 re649dfa 33 33 inline int isFloat32SigNaN(float32 f); 34 34 35 inline int isFloat32Infinity(float32 f) 36 37 inline int isFloat32eq(float32 a, float32 b); 38 inline int isFloat32lt(float32 a, float32 b); 39 inline int isFloat32gt(float32 a, float32 b); 40 35 41 #endif 36 42
Note:
See TracChangeset
for help on using the changeset viewer.