@ -4941,226 +4941,6 @@ float64 float64_log2(float64 a, float_status *status)
return normalizeRoundAndPackFloat64 ( zSign , 0x408 , zSig , status ) ;
}
/*----------------------------------------------------------------------------
| Returns 1 if the double - precision floating - point value ` a ' is equal to the
| corresponding value ` b ' , and 0 otherwise . The invalid exception is raised
| if either operand is a NaN . Otherwise , the comparison is performed
| according to the IEC / IEEE Standard for Binary Floating - Point Arithmetic .
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
int float64_eq ( float64 a , float64 b , float_status * status )
{
uint64_t av , bv ;
a = float64_squash_input_denormal ( a , status ) ;
b = float64_squash_input_denormal ( b , status ) ;
if ( ( ( extractFloat64Exp ( a ) = = 0x7FF ) & & extractFloat64Frac ( a ) )
| | ( ( extractFloat64Exp ( b ) = = 0x7FF ) & & extractFloat64Frac ( b ) )
) {
float_raise ( float_flag_invalid , status ) ;
return 0 ;
}
av = float64_val ( a ) ;
bv = float64_val ( b ) ;
return ( av = = bv ) | | ( ( uint64_t ) ( ( av | bv ) < < 1 ) = = 0 ) ;
}
/*----------------------------------------------------------------------------
| Returns 1 if the double - precision floating - point value ` a ' is less than or
| equal to the corresponding value ` b ' , and 0 otherwise . The invalid
| exception is raised if either operand is a NaN . The comparison is performed
| according to the IEC / IEEE Standard for Binary Floating - Point Arithmetic .
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
int float64_le ( float64 a , float64 b , float_status * status )
{
bool aSign , bSign ;
uint64_t av , bv ;
a = float64_squash_input_denormal ( a , status ) ;
b = float64_squash_input_denormal ( b , status ) ;
if ( ( ( extractFloat64Exp ( a ) = = 0x7FF ) & & extractFloat64Frac ( a ) )
| | ( ( extractFloat64Exp ( b ) = = 0x7FF ) & & extractFloat64Frac ( b ) )
) {
float_raise ( float_flag_invalid , status ) ;
return 0 ;
}
aSign = extractFloat64Sign ( a ) ;
bSign = extractFloat64Sign ( b ) ;
av = float64_val ( a ) ;
bv = float64_val ( b ) ;
if ( aSign ! = bSign ) return aSign | | ( ( uint64_t ) ( ( av | bv ) < < 1 ) = = 0 ) ;
return ( av = = bv ) | | ( aSign ^ ( av < bv ) ) ;
}
/*----------------------------------------------------------------------------
| Returns 1 if the double - precision floating - point value ` a ' is less than
| the corresponding value ` b ' , and 0 otherwise . The invalid exception is
| raised if either operand is a NaN . The comparison is performed according
| to the IEC / IEEE Standard for Binary Floating - Point Arithmetic .
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
int float64_lt ( float64 a , float64 b , float_status * status )
{
bool aSign , bSign ;
uint64_t av , bv ;
a = float64_squash_input_denormal ( a , status ) ;
b = float64_squash_input_denormal ( b , status ) ;
if ( ( ( extractFloat64Exp ( a ) = = 0x7FF ) & & extractFloat64Frac ( a ) )
| | ( ( extractFloat64Exp ( b ) = = 0x7FF ) & & extractFloat64Frac ( b ) )
) {
float_raise ( float_flag_invalid , status ) ;
return 0 ;
}
aSign = extractFloat64Sign ( a ) ;
bSign = extractFloat64Sign ( b ) ;
av = float64_val ( a ) ;
bv = float64_val ( b ) ;
if ( aSign ! = bSign ) return aSign & & ( ( uint64_t ) ( ( av | bv ) < < 1 ) ! = 0 ) ;
return ( av ! = bv ) & & ( aSign ^ ( av < bv ) ) ;
}
/*----------------------------------------------------------------------------
| Returns 1 if the double - precision floating - point values ` a ' and ` b ' cannot
| be compared , and 0 otherwise . The invalid exception is raised if either
| operand is a NaN . The comparison is performed according to the IEC / IEEE
| Standard for Binary Floating - Point Arithmetic .
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
int float64_unordered ( float64 a , float64 b , float_status * status )
{
a = float64_squash_input_denormal ( a , status ) ;
b = float64_squash_input_denormal ( b , status ) ;
if ( ( ( extractFloat64Exp ( a ) = = 0x7FF ) & & extractFloat64Frac ( a ) )
| | ( ( extractFloat64Exp ( b ) = = 0x7FF ) & & extractFloat64Frac ( b ) )
) {
float_raise ( float_flag_invalid , status ) ;
return 1 ;
}
return 0 ;
}
/*----------------------------------------------------------------------------
| Returns 1 if the double - precision floating - point value ` a ' is equal to the
| corresponding value ` b ' , and 0 otherwise . Quiet NaNs do not cause an
| exception . The comparison is performed according to the IEC / IEEE Standard
| for Binary Floating - Point Arithmetic .
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
int float64_eq_quiet ( float64 a , float64 b , float_status * status )
{
uint64_t av , bv ;
a = float64_squash_input_denormal ( a , status ) ;
b = float64_squash_input_denormal ( b , status ) ;
if ( ( ( extractFloat64Exp ( a ) = = 0x7FF ) & & extractFloat64Frac ( a ) )
| | ( ( extractFloat64Exp ( b ) = = 0x7FF ) & & extractFloat64Frac ( b ) )
) {
if ( float64_is_signaling_nan ( a , status )
| | float64_is_signaling_nan ( b , status ) ) {
float_raise ( float_flag_invalid , status ) ;
}
return 0 ;
}
av = float64_val ( a ) ;
bv = float64_val ( b ) ;
return ( av = = bv ) | | ( ( uint64_t ) ( ( av | bv ) < < 1 ) = = 0 ) ;
}
/*----------------------------------------------------------------------------
| Returns 1 if the double - precision floating - point value ` a ' is less than or
| equal to the corresponding value ` b ' , and 0 otherwise . Quiet NaNs do not
| cause an exception . Otherwise , the comparison is performed according to the
| IEC / IEEE Standard for Binary Floating - Point Arithmetic .
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
int float64_le_quiet ( float64 a , float64 b , float_status * status )
{
bool aSign , bSign ;
uint64_t av , bv ;
a = float64_squash_input_denormal ( a , status ) ;
b = float64_squash_input_denormal ( b , status ) ;
if ( ( ( extractFloat64Exp ( a ) = = 0x7FF ) & & extractFloat64Frac ( a ) )
| | ( ( extractFloat64Exp ( b ) = = 0x7FF ) & & extractFloat64Frac ( b ) )
) {
if ( float64_is_signaling_nan ( a , status )
| | float64_is_signaling_nan ( b , status ) ) {
float_raise ( float_flag_invalid , status ) ;
}
return 0 ;
}
aSign = extractFloat64Sign ( a ) ;
bSign = extractFloat64Sign ( b ) ;
av = float64_val ( a ) ;
bv = float64_val ( b ) ;
if ( aSign ! = bSign ) return aSign | | ( ( uint64_t ) ( ( av | bv ) < < 1 ) = = 0 ) ;
return ( av = = bv ) | | ( aSign ^ ( av < bv ) ) ;
}
/*----------------------------------------------------------------------------
| Returns 1 if the double - precision floating - point value ` a ' is less than
| the corresponding value ` b ' , and 0 otherwise . Quiet NaNs do not cause an
| exception . Otherwise , the comparison is performed according to the IEC / IEEE
| Standard for Binary Floating - Point Arithmetic .
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
int float64_lt_quiet ( float64 a , float64 b , float_status * status )
{
bool aSign , bSign ;
uint64_t av , bv ;
a = float64_squash_input_denormal ( a , status ) ;
b = float64_squash_input_denormal ( b , status ) ;
if ( ( ( extractFloat64Exp ( a ) = = 0x7FF ) & & extractFloat64Frac ( a ) )
| | ( ( extractFloat64Exp ( b ) = = 0x7FF ) & & extractFloat64Frac ( b ) )
) {
if ( float64_is_signaling_nan ( a , status )
| | float64_is_signaling_nan ( b , status ) ) {
float_raise ( float_flag_invalid , status ) ;
}
return 0 ;
}
aSign = extractFloat64Sign ( a ) ;
bSign = extractFloat64Sign ( b ) ;
av = float64_val ( a ) ;
bv = float64_val ( b ) ;
if ( aSign ! = bSign ) return aSign & & ( ( uint64_t ) ( ( av | bv ) < < 1 ) ! = 0 ) ;
return ( av ! = bv ) & & ( aSign ^ ( av < bv ) ) ;
}
/*----------------------------------------------------------------------------
| Returns 1 if the double - precision floating - point values ` a ' and ` b ' cannot
| be compared , and 0 otherwise . Quiet NaNs do not cause an exception . The
| comparison is performed according to the IEC / IEEE Standard for Binary
| Floating - Point Arithmetic .
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
int float64_unordered_quiet ( float64 a , float64 b , float_status * status )
{
a = float64_squash_input_denormal ( a , status ) ;
b = float64_squash_input_denormal ( b , status ) ;
if ( ( ( extractFloat64Exp ( a ) = = 0x7FF ) & & extractFloat64Frac ( a ) )
| | ( ( extractFloat64Exp ( b ) = = 0x7FF ) & & extractFloat64Frac ( b ) )
) {
if ( float64_is_signaling_nan ( a , status )
| | float64_is_signaling_nan ( b , status ) ) {
float_raise ( float_flag_invalid , status ) ;
}
return 1 ;
}
return 0 ;
}
/*----------------------------------------------------------------------------
| Returns the result of converting the extended double - precision floating -
| point value ` a ' to the 32 - bit two ' s complement integer format . The