Skip to contentSkip to conversation

target-arm: fix for exponent comparison in recpe_f64

PATCH Applied [email protected] 2 participants 2 messages Feb 5, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-arm: fix for exponent comparison in recpe_f64

From: Ildar Isaev <[email protected]>

f64 exponent in HELPER(recpe_f64) should be compared to 2045 rather than 1023 (FPRecipEstimate in ARMV8 spec)

---
 target-arm/helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-arm/helper.c +1 -1
index 1a5e067..f2feec4 100644
@@ -6242,7 +6242,7 @@ float64 HELPER(recpe_f64)(float64 input, void *fpstp)
         } else {
             return float64_set_sign(float64_maxnorm, float64_is_neg(f64));
         }
-    } else if (f64_exp >= 1023 && fpst->flush_to_zero) {
+    } else if (f64_exp >= 2045 && fpst->flush_to_zero) {
         float_raise(float_flag_underflow, fpst);
         return float64_set_sign(float64_zero, float64_is_neg(f64));
     }
Signature · 1 line
1.9.3
#1 lore raw
Quoted 9 lines · On 5 February 2015 at 11:27, <[email protected]> wrote:

From: Ildar Isaev <[email protected]>

f64 exponent in HELPER(recpe_f64) should be compared to 2045 rather than 1023 (FPRecipEstimate in ARMV8 spec)

---
 target-arm/helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, applied to target-arm.next. I tweaked the commit message a little to add

"This fixes incorrect underflow handling when flushing denormals to zero in the FRECPE instructions operating on 64-bit values."

just to clarify the scope of the bug a little.

-- PMM