Lines Matching refs:a

12 of this code was written as part of a project to build a fixed-point vector
43 defined here if desired. It is currently not possible for such a trap to
44 substitute a result value. If traps are not implemented, this routine
71 The pattern for a default generated single-precision NaN.
78 Returns 1 if the single-precision floating-point value `a' is a NaN;
82 flag float32_is_nan( float32 a )
85 return ( 0xFF000000 < (bits32) ( a<<1 ) );
91 Returns 1 if the single-precision floating-point value `a' is a signaling
95 flag float32_is_signaling_nan( float32 a )
98 return ( ( ( a>>22 ) & 0x1FF ) == 0x1FE ) && ( a & 0x003FFFFF );
105 `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid
109 static commonNaNT float32ToCommonNaN( float32 a )
113 if ( float32_is_signaling_nan( a ) ) float_raise( float_flag_invalid );
114 z.sign = a>>31;
116 z.high = ( (bits64) a )<<41;
123 Returns the result of converting the canonical NaN `a' to the single-
127 static float32 commonNaNToFloat32( commonNaNT a )
130 return ( ( (bits32) a.sign )<<31 ) | 0x7FC00000 | ( a.high>>41 );
136 Takes two single-precision floating-point values `a' and `b', one of which
137 is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a
141 static float32 propagateFloat32NaN( float32 a, float32 b )
145 aIsNaN = float32_is_nan( a );
146 aIsSignalingNaN = float32_is_signaling_nan( a );
149 a |= 0x00400000;
153 return ( aIsSignalingNaN & bIsNaN ) ? b : a;
163 The pattern for a default generated double-precision NaN.
170 Returns 1 if the double-precision floating-point value `a' is a NaN;
174 flag float64_is_nan( float64 a )
177 return ( LIT64( 0xFFE0000000000000 ) < (bits64) ( a<<1 ) );
183 Returns 1 if the double-precision floating-point value `a' is a signaling
187 flag float64_is_signaling_nan( float64 a )
191 ( ( ( a>>51 ) & 0xFFF ) == 0xFFE )
192 && ( a & LIT64( 0x0007FFFFFFFFFFFF ) );
199 `a' to the canonical NaN format. If `a' is a signaling NaN, the invalid
203 static commonNaNT float64ToCommonNaN( float64 a )
207 if ( float64_is_signaling_nan( a ) ) float_raise( float_flag_invalid );
208 z.sign = a>>63;
210 z.high = a<<12;
217 Returns the result of converting the canonical NaN `a' to the double-
221 static float64 commonNaNToFloat64( commonNaNT a )
225 ( ( (bits64) a.sign )<<63 )
227 | ( a.high>>12 );
233 Takes two double-precision floating-point values `a' and `b', one of which
234 is a NaN, and returns the appropriate NaN result. If either `a' or `b' is a
238 static float64 propagateFloat64NaN( float64 a, float64 b )
242 aIsNaN = float64_is_nan( a );
243 aIsSignalingNaN = float64_is_signaling_nan( a );
246 a |= LIT64( 0x0008000000000000 );
250 return ( aIsSignalingNaN & bIsNaN ) ? b : a;
262 The pattern for a default generated extended double-precision NaN. The
272 Returns 1 if the extended double-precision floating-point value `a' is a
276 flag floatx80_is_nan( floatx80 a )
279 return ( ( a.high & 0x7FFF ) == 0x7FFF ) && (bits64) ( a.low<<1 );
285 Returns 1 if the extended double-precision floating-point value `a' is a
289 flag floatx80_is_signaling_nan( floatx80 a )
296 aLow = a.low & ~ LIT64( 0x4000000000000000 );
298 ( ( a.high & 0x7FFF ) == 0x7FFF )
300 && ( a.low == aLow );
307 point NaN `a' to the canonical NaN format. If `a' is a signaling NaN, the
311 static commonNaNT floatx80ToCommonNaN( floatx80 a )
315 if ( floatx80_is_signaling_nan( a ) ) float_raise( float_flag_invalid );
316 z.sign = a.high>>15;
318 z.high = a.low<<1;
325 Returns the result of converting the canonical NaN `a' to the extended
329 static floatx80 commonNaNToFloatx80( commonNaNT a )
333 z.low = LIT64( 0xC000000000000000 ) | ( a.high>>1 );
334 z.high = ( ( (bits16) a.sign )<<15 ) | 0x7FFF;
341 Takes two extended double-precision floating-point values `a' and `b', one
342 of which is a NaN, and returns the appropriate NaN result. If either `a' or
343 `b' is a signaling NaN, the invalid exception is raised.
346 static floatx80 propagateFloatx80NaN( floatx80 a, floatx80 b )
350 aIsNaN = floatx80_is_nan( a );
351 aIsSignalingNaN = floatx80_is_signaling_nan( a );
354 a.low |= LIT64( 0xC000000000000000 );
358 return ( aIsSignalingNaN & bIsNaN ) ? b : a;