2314 |
2314 |
|
2315 |
2315 |
/*----------------------------------------------------------------------------
|
2316 |
2316 |
| Returns 1 if the single-precision floating-point value `a' is equal to
|
2317 |
|
| the corresponding value `b', and 0 otherwise. The comparison is performed
|
|
2317 |
| the corresponding value `b', and 0 otherwise. The invalid exception is
|
|
2318 |
| raised if either operand is a NaN. Otherwise, the comparison is performed
|
2318 |
2319 |
| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic.
|
2319 |
2320 |
*----------------------------------------------------------------------------*/
|
2320 |
2321 |
|
2321 |
|
int float32_eq_quiet( float32 a, float32 b STATUS_PARAM )
|
|
2322 |
int float32_eq( float32 a, float32 b STATUS_PARAM )
|
2322 |
2323 |
{
|
|
2324 |
uint32_t av, bv;
|
2323 |
2325 |
a = float32_squash_input_denormal(a STATUS_VAR);
|
2324 |
2326 |
b = float32_squash_input_denormal(b STATUS_VAR);
|
2325 |
2327 |
|
2326 |
2328 |
if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) )
|
2327 |
2329 |
|| ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) )
|
2328 |
2330 |
) {
|
2329 |
|
if ( float32_is_signaling_nan( a ) || float32_is_signaling_nan( b ) ) {
|
2330 |
|
float_raise( float_flag_invalid STATUS_VAR);
|
2331 |
|
}
|
|
2331 |
float_raise( float_flag_invalid STATUS_VAR);
|
2332 |
2332 |
return 0;
|
2333 |
2333 |
}
|
2334 |
|
return ( float32_val(a) == float32_val(b) ) ||
|
2335 |
|
( (uint32_t) ( ( float32_val(a) | float32_val(b) )<<1 ) == 0 );
|
2336 |
|
|
|
2334 |
av = float32_val(a);
|
|
2335 |
bv = float32_val(b);
|
|
2336 |
return ( av == bv ) || ( (uint32_t) ( ( av | bv )<<1 ) == 0 );
|
2337 |
2337 |
}
|
2338 |
2338 |
|
2339 |
2339 |
/*----------------------------------------------------------------------------
|
... | ... | |
2412 |
2412 |
}
|
2413 |
2413 |
return 0;
|
2414 |
2414 |
}
|
|
2415 |
|
2415 |
2416 |
/*----------------------------------------------------------------------------
|
2416 |
2417 |
| Returns 1 if the single-precision floating-point value `a' is equal to
|
2417 |
|
| the corresponding value `b', and 0 otherwise. The invalid exception is
|
2418 |
|
| raised if either operand is a NaN. Otherwise, the comparison is performed
|
|
2418 |
| the corresponding value `b', and 0 otherwise. The comparison is performed
|
2419 |
2419 |
| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic.
|
2420 |
2420 |
*----------------------------------------------------------------------------*/
|
2421 |
2421 |
|
2422 |
|
int float32_eq( float32 a, float32 b STATUS_PARAM )
|
|
2422 |
int float32_eq_quiet( float32 a, float32 b STATUS_PARAM )
|
2423 |
2423 |
{
|
2424 |
|
uint32_t av, bv;
|
2425 |
2424 |
a = float32_squash_input_denormal(a STATUS_VAR);
|
2426 |
2425 |
b = float32_squash_input_denormal(b STATUS_VAR);
|
2427 |
2426 |
|
2428 |
2427 |
if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) )
|
2429 |
2428 |
|| ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) )
|
2430 |
2429 |
) {
|
2431 |
|
float_raise( float_flag_invalid STATUS_VAR);
|
|
2430 |
if ( float32_is_signaling_nan( a ) || float32_is_signaling_nan( b ) ) {
|
|
2431 |
float_raise( float_flag_invalid STATUS_VAR);
|
|
2432 |
}
|
2432 |
2433 |
return 0;
|
2433 |
2434 |
}
|
2434 |
|
av = float32_val(a);
|
2435 |
|
bv = float32_val(b);
|
2436 |
|
return ( av == bv ) || ( (uint32_t) ( ( av | bv )<<1 ) == 0 );
|
2437 |
|
|
|
2435 |
return ( float32_val(a) == float32_val(b) ) ||
|
|
2436 |
( (uint32_t) ( ( float32_val(a) | float32_val(b) )<<1 ) == 0 );
|
2438 |
2437 |
}
|
2439 |
2438 |
|
2440 |
2439 |
/*----------------------------------------------------------------------------
|
... | ... | |
3578 |
3577 |
|
3579 |
3578 |
/*----------------------------------------------------------------------------
|
3580 |
3579 |
| Returns 1 if the double-precision floating-point value `a' is equal to the
|
3581 |
|
| corresponding value `b', and 0 otherwise. The comparison is performed
|
|
3580 |
| corresponding value `b', and 0 otherwise. The invalid exception is raised
|
|
3581 |
| if either operand is a NaN. Otherwise, the comparison is performed
|
3582 |
3582 |
| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic.
|
3583 |
3583 |
*----------------------------------------------------------------------------*/
|
3584 |
3584 |
|
3585 |
|
int float64_eq_quiet( float64 a, float64 b STATUS_PARAM )
|
|
3585 |
int float64_eq( float64 a, float64 b STATUS_PARAM )
|
3586 |
3586 |
{
|
3587 |
3587 |
uint64_t av, bv;
|
3588 |
3588 |
a = float64_squash_input_denormal(a STATUS_VAR);
|
... | ... | |
3591 |
3591 |
if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) )
|
3592 |
3592 |
|| ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) )
|
3593 |
3593 |
) {
|
3594 |
|
if ( float64_is_signaling_nan( a ) || float64_is_signaling_nan( b ) ) {
|
3595 |
|
float_raise( float_flag_invalid STATUS_VAR);
|
3596 |
|
}
|
|
3594 |
float_raise( float_flag_invalid STATUS_VAR);
|
3597 |
3595 |
return 0;
|
3598 |
3596 |
}
|
3599 |
3597 |
av = float64_val(a);
|
... | ... | |
3681 |
3679 |
|
3682 |
3680 |
/*----------------------------------------------------------------------------
|
3683 |
3681 |
| Returns 1 if the double-precision floating-point value `a' is equal to the
|
3684 |
|
| corresponding value `b', and 0 otherwise. The invalid exception is raised
|
3685 |
|
| if either operand is a NaN. Otherwise, the comparison is performed
|
|
3682 |
| corresponding value `b', and 0 otherwise. The comparison is performed
|
3686 |
3683 |
| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic.
|
3687 |
3684 |
*----------------------------------------------------------------------------*/
|
3688 |
3685 |
|
3689 |
|
int float64_eq( float64 a, float64 b STATUS_PARAM )
|
|
3686 |
int float64_eq_quiet( float64 a, float64 b STATUS_PARAM )
|
3690 |
3687 |
{
|
3691 |
3688 |
uint64_t av, bv;
|
3692 |
3689 |
a = float64_squash_input_denormal(a STATUS_VAR);
|
... | ... | |
3695 |
3692 |
if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) )
|
3696 |
3693 |
|| ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) )
|
3697 |
3694 |
) {
|
3698 |
|
float_raise( float_flag_invalid STATUS_VAR);
|
|
3695 |
if ( float64_is_signaling_nan( a ) || float64_is_signaling_nan( b ) ) {
|
|
3696 |
float_raise( float_flag_invalid STATUS_VAR);
|
|
3697 |
}
|
3699 |
3698 |
return 0;
|
3700 |
3699 |
}
|
3701 |
3700 |
av = float64_val(a);
|
... | ... | |
4586 |
4585 |
}
|
4587 |
4586 |
|
4588 |
4587 |
/*----------------------------------------------------------------------------
|
4589 |
|
| Returns 1 if the extended double-precision floating-point value `a' is
|
4590 |
|
| equal to the corresponding value `b', and 0 otherwise. The comparison is
|
4591 |
|
| performed according to the IEC/IEEE Standard for Binary Floating-Point
|
4592 |
|
| Arithmetic.
|
|
4588 |
| Returns 1 if the extended double-precision floating-point value `a' is equal
|
|
4589 |
| to the corresponding value `b', and 0 otherwise. The invalid exception is
|
|
4590 |
| raised if either operand is a NaN. Otherwise, the comparison is performed
|
|
4591 |
| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic.
|
4593 |
4592 |
*----------------------------------------------------------------------------*/
|
4594 |
4593 |
|
4595 |
|
int floatx80_eq_quiet( floatx80 a, floatx80 b STATUS_PARAM )
|
|
4594 |
int floatx80_eq( floatx80 a, floatx80 b STATUS_PARAM )
|
4596 |
4595 |
{
|
4597 |
4596 |
|
4598 |
4597 |
if ( ( ( extractFloatx80Exp( a ) == 0x7FFF )
|
... | ... | |
4600 |
4599 |
|| ( ( extractFloatx80Exp( b ) == 0x7FFF )
|
4601 |
4600 |
&& (uint64_t) ( extractFloatx80Frac( b )<<1 ) )
|
4602 |
4601 |
) {
|
4603 |
|
if ( floatx80_is_signaling_nan( a )
|
4604 |
|
|| floatx80_is_signaling_nan( b ) ) {
|
4605 |
|
float_raise( float_flag_invalid STATUS_VAR);
|
4606 |
|
}
|
|
4602 |
float_raise( float_flag_invalid STATUS_VAR);
|
4607 |
4603 |
return 0;
|
4608 |
4604 |
}
|
4609 |
4605 |
return
|
... | ... | |
4700 |
4696 |
}
|
4701 |
4697 |
|
4702 |
4698 |
/*----------------------------------------------------------------------------
|
4703 |
|
| Returns 1 if the extended double-precision floating-point value `a' is equal
|
4704 |
|
| to the corresponding value `b', and 0 otherwise. The invalid exception is
|
4705 |
|
| raised if either operand is a NaN. Otherwise, the comparison is performed
|
4706 |
|
| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic.
|
|
4699 |
| Returns 1 if the extended double-precision floating-point value `a' is
|
|
4700 |
| equal to the corresponding value `b', and 0 otherwise. The comparison is
|
|
4701 |
| performed according to the IEC/IEEE Standard for Binary Floating-Point
|
|
4702 |
| Arithmetic.
|
4707 |
4703 |
*----------------------------------------------------------------------------*/
|
4708 |
4704 |
|
4709 |
|
int floatx80_eq( floatx80 a, floatx80 b STATUS_PARAM )
|
|
4705 |
int floatx80_eq_quiet( floatx80 a, floatx80 b STATUS_PARAM )
|
4710 |
4706 |
{
|
4711 |
4707 |
|
4712 |
4708 |
if ( ( ( extractFloatx80Exp( a ) == 0x7FFF )
|
... | ... | |
4714 |
4710 |
|| ( ( extractFloatx80Exp( b ) == 0x7FFF )
|
4715 |
4711 |
&& (uint64_t) ( extractFloatx80Frac( b )<<1 ) )
|
4716 |
4712 |
) {
|
4717 |
|
float_raise( float_flag_invalid STATUS_VAR);
|
|
4713 |
if ( floatx80_is_signaling_nan( a )
|
|
4714 |
|| floatx80_is_signaling_nan( b ) ) {
|
|
4715 |
float_raise( float_flag_invalid STATUS_VAR);
|
|
4716 |
}
|
4718 |
4717 |
return 0;
|
4719 |
4718 |
}
|
4720 |
4719 |
return
|
... | ... | |
5750 |
5749 |
|
5751 |
5750 |
/*----------------------------------------------------------------------------
|
5752 |
5751 |
| Returns 1 if the quadruple-precision floating-point value `a' is equal to
|
5753 |
|
| the corresponding value `b', and 0 otherwise. The comparison is performed
|
|
5752 |
| the corresponding value `b', and 0 otherwise. The invalid exception is
|
|
5753 |
| raised if either operand is a NaN. Otherwise, the comparison is performed
|
5754 |
5754 |
| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic.
|
5755 |
5755 |
*----------------------------------------------------------------------------*/
|
5756 |
5756 |
|
5757 |
|
int float128_eq_quiet( float128 a, float128 b STATUS_PARAM )
|
|
5757 |
int float128_eq( float128 a, float128 b STATUS_PARAM )
|
5758 |
5758 |
{
|
5759 |
5759 |
|
5760 |
5760 |
if ( ( ( extractFloat128Exp( a ) == 0x7FFF )
|
... | ... | |
5762 |
5762 |
|| ( ( extractFloat128Exp( b ) == 0x7FFF )
|
5763 |
5763 |
&& ( extractFloat128Frac0( b ) | extractFloat128Frac1( b ) ) )
|
5764 |
5764 |
) {
|
5765 |
|
if ( float128_is_signaling_nan( a )
|
5766 |
|
|| float128_is_signaling_nan( b ) ) {
|
5767 |
|
float_raise( float_flag_invalid STATUS_VAR);
|
5768 |
|
}
|
|
5765 |
float_raise( float_flag_invalid STATUS_VAR);
|
5769 |
5766 |
return 0;
|
5770 |
5767 |
}
|
5771 |
5768 |
return
|
... | ... | |
5863 |
5860 |
|
5864 |
5861 |
/*----------------------------------------------------------------------------
|
5865 |
5862 |
| Returns 1 if the quadruple-precision floating-point value `a' is equal to
|
5866 |
|
| the corresponding value `b', and 0 otherwise. The invalid exception is
|
5867 |
|
| raised if either operand is a NaN. Otherwise, the comparison is performed
|
|
5863 |
| the corresponding value `b', and 0 otherwise. The comparison is performed
|
5868 |
5864 |
| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic.
|
5869 |
5865 |
*----------------------------------------------------------------------------*/
|
5870 |
5866 |
|
5871 |
|
int float128_eq( float128 a, float128 b STATUS_PARAM )
|
|
5867 |
int float128_eq_quiet( float128 a, float128 b STATUS_PARAM )
|
5872 |
5868 |
{
|
5873 |
5869 |
|
5874 |
5870 |
if ( ( ( extractFloat128Exp( a ) == 0x7FFF )
|
... | ... | |
5876 |
5872 |
|| ( ( extractFloat128Exp( b ) == 0x7FFF )
|
5877 |
5873 |
&& ( extractFloat128Frac0( b ) | extractFloat128Frac1( b ) ) )
|
5878 |
5874 |
) {
|
5879 |
|
float_raise( float_flag_invalid STATUS_VAR);
|
|
5875 |
if ( float128_is_signaling_nan( a )
|
|
5876 |
|| float128_is_signaling_nan( b ) ) {
|
|
5877 |
float_raise( float_flag_invalid STATUS_VAR);
|
|
5878 |
}
|
5880 |
5879 |
return 0;
|
5881 |
5880 |
}
|
5882 |
5881 |
return
|