diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2005-08-15 15:42:32 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-08-15 15:42:32 -0400 |
commit | 54738e82755f73080e779ba0c8052e232df24d78 (patch) | |
tree | a00032413cc28576443fbcf5eaeb915bb23dcceb | |
parent | d93742f5a73c3dff641732c029836170f86392d2 (diff) |
[PATCH] ARM: 2851/1: Fix NWFPE extended precision exception handling
Patch from Richard Purdie
The exception handling code fails to compile if the extended
precision mode is enabled. This patch fixes those compile errors and
also stops _quiet functions from incorrectly raising exceptions.
Reported-by: Ralph Siemsen <ralphs@netwinder.org>
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/nwfpe/softfloat.c | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/arch/arm/nwfpe/softfloat.c b/arch/arm/nwfpe/softfloat.c index 8b75a6e7cb3a..f9f049132a17 100644 --- a/arch/arm/nwfpe/softfloat.c +++ b/arch/arm/nwfpe/softfloat.c | |||
@@ -1602,9 +1602,7 @@ flag float32_le_quiet( float32 a, float32 b ) | |||
1602 | if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) | 1602 | if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) |
1603 | || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) ) | 1603 | || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) ) |
1604 | ) { | 1604 | ) { |
1605 | if ( float32_is_signaling_nan( a ) || float32_is_signaling_nan( b ) ) { | 1605 | /* Do nothing, even if NaN as we're quiet */ |
1606 | float_raise( float_flag_invalid ); | ||
1607 | } | ||
1608 | return 0; | 1606 | return 0; |
1609 | } | 1607 | } |
1610 | aSign = extractFloat32Sign( a ); | 1608 | aSign = extractFloat32Sign( a ); |
@@ -1629,9 +1627,7 @@ flag float32_lt_quiet( float32 a, float32 b ) | |||
1629 | if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) | 1627 | if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) |
1630 | || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) ) | 1628 | || ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) ) |
1631 | ) { | 1629 | ) { |
1632 | if ( float32_is_signaling_nan( a ) || float32_is_signaling_nan( b ) ) { | 1630 | /* Do nothing, even if NaN as we're quiet */ |
1633 | float_raise( float_flag_invalid ); | ||
1634 | } | ||
1635 | return 0; | 1631 | return 0; |
1636 | } | 1632 | } |
1637 | aSign = extractFloat32Sign( a ); | 1633 | aSign = extractFloat32Sign( a ); |
@@ -2493,9 +2489,7 @@ flag float64_le_quiet( float64 a, float64 b ) | |||
2493 | if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) | 2489 | if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) |
2494 | || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) ) | 2490 | || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) ) |
2495 | ) { | 2491 | ) { |
2496 | if ( float64_is_signaling_nan( a ) || float64_is_signaling_nan( b ) ) { | 2492 | /* Do nothing, even if NaN as we're quiet */ |
2497 | float_raise( float_flag_invalid ); | ||
2498 | } | ||
2499 | return 0; | 2493 | return 0; |
2500 | } | 2494 | } |
2501 | aSign = extractFloat64Sign( a ); | 2495 | aSign = extractFloat64Sign( a ); |
@@ -2520,9 +2514,7 @@ flag float64_lt_quiet( float64 a, float64 b ) | |||
2520 | if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) | 2514 | if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) |
2521 | || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) ) | 2515 | || ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) ) |
2522 | ) { | 2516 | ) { |
2523 | if ( float64_is_signaling_nan( a ) || float64_is_signaling_nan( b ) ) { | 2517 | /* Do nothing, even if NaN as we're quiet */ |
2524 | float_raise( float_flag_invalid ); | ||
2525 | } | ||
2526 | return 0; | 2518 | return 0; |
2527 | } | 2519 | } |
2528 | aSign = extractFloat64Sign( a ); | 2520 | aSign = extractFloat64Sign( a ); |
@@ -3256,7 +3248,7 @@ flag floatx80_eq( floatx80 a, floatx80 b ) | |||
3256 | ) { | 3248 | ) { |
3257 | if ( floatx80_is_signaling_nan( a ) | 3249 | if ( floatx80_is_signaling_nan( a ) |
3258 | || floatx80_is_signaling_nan( b ) ) { | 3250 | || floatx80_is_signaling_nan( b ) ) { |
3259 | roundData->exception |= float_flag_invalid; | 3251 | float_raise( float_flag_invalid ); |
3260 | } | 3252 | } |
3261 | return 0; | 3253 | return 0; |
3262 | } | 3254 | } |
@@ -3286,7 +3278,7 @@ flag floatx80_le( floatx80 a, floatx80 b ) | |||
3286 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) | 3278 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) |
3287 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) | 3279 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) |
3288 | ) { | 3280 | ) { |
3289 | roundData->exception |= float_flag_invalid; | 3281 | float_raise( float_flag_invalid ); |
3290 | return 0; | 3282 | return 0; |
3291 | } | 3283 | } |
3292 | aSign = extractFloatx80Sign( a ); | 3284 | aSign = extractFloatx80Sign( a ); |
@@ -3320,7 +3312,7 @@ flag floatx80_lt( floatx80 a, floatx80 b ) | |||
3320 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) | 3312 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) |
3321 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) | 3313 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) |
3322 | ) { | 3314 | ) { |
3323 | roundData->exception |= float_flag_invalid; | 3315 | float_raise( float_flag_invalid ); |
3324 | return 0; | 3316 | return 0; |
3325 | } | 3317 | } |
3326 | aSign = extractFloatx80Sign( a ); | 3318 | aSign = extractFloatx80Sign( a ); |
@@ -3353,7 +3345,7 @@ flag floatx80_eq_signaling( floatx80 a, floatx80 b ) | |||
3353 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) | 3345 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) |
3354 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) | 3346 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) |
3355 | ) { | 3347 | ) { |
3356 | roundData->exception |= float_flag_invalid; | 3348 | float_raise( float_flag_invalid ); |
3357 | return 0; | 3349 | return 0; |
3358 | } | 3350 | } |
3359 | return | 3351 | return |
@@ -3382,10 +3374,7 @@ flag floatx80_le_quiet( floatx80 a, floatx80 b ) | |||
3382 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) | 3374 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) |
3383 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) | 3375 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) |
3384 | ) { | 3376 | ) { |
3385 | if ( floatx80_is_signaling_nan( a ) | 3377 | /* Do nothing, even if NaN as we're quiet */ |
3386 | || floatx80_is_signaling_nan( b ) ) { | ||
3387 | roundData->exception |= float_flag_invalid; | ||
3388 | } | ||
3389 | return 0; | 3378 | return 0; |
3390 | } | 3379 | } |
3391 | aSign = extractFloatx80Sign( a ); | 3380 | aSign = extractFloatx80Sign( a ); |
@@ -3419,10 +3408,7 @@ flag floatx80_lt_quiet( floatx80 a, floatx80 b ) | |||
3419 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) | 3408 | || ( ( extractFloatx80Exp( b ) == 0x7FFF ) |
3420 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) | 3409 | && (bits64) ( extractFloatx80Frac( b )<<1 ) ) |
3421 | ) { | 3410 | ) { |
3422 | if ( floatx80_is_signaling_nan( a ) | 3411 | /* Do nothing, even if NaN as we're quiet */ |
3423 | || floatx80_is_signaling_nan( b ) ) { | ||
3424 | roundData->exception |= float_flag_invalid; | ||
3425 | } | ||
3426 | return 0; | 3412 | return 0; |
3427 | } | 3413 | } |
3428 | aSign = extractFloatx80Sign( a ); | 3414 | aSign = extractFloatx80Sign( a ); |