Skip to contentSkip to conversation

or1k: Do not clear existing FPU exceptions before updating

PATCH In review Stafford Horne 1 participant 2 messages Mar 18, 2023 – Mar 19, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 or1k: Do not clear existing FPU exceptions before updating

We should always carry the exceptions forward. This bug was found when working on testing glibc math tests, many tests were failing with Overflow and Underflow flags not set. This was traced to here.

libgcc/ChangeLog:

* config/or1k/sfp-machine.h (FP_HANDLE_EXCEPTIONS): Remove statement clearing existing exceptions.

---
 libgcc/config/or1k/sfp-machine.h | 1 -
 1 file changed, 1 deletion(-)
libgcc/config/or1k/sfp-machine.h +0 -1
index 162c6bc5326..c804270fb3c 100644
@@ -73,7 +73,6 @@ do {								\
 do {								\
   if (__builtin_expect (_fex, 0))				\
     {								\
-      _fpcsr &= ~FP_EX_ALL;					\
       _fpcsr |= _fex;						\
       __asm__ volatile ("l.mtspr r0,%0,20" : : "r" (_fpcsr));	\
     }								\
Signature · 1 line
2.39.1
#1 lore raw

Hello,

I pushed this upstream.

Quoted 27 lines · Stafford Horne

We should always carry the exceptions forward. This bug was found when working on testing glibc math tests, many tests were failing with Overflow and Underflow flags not set. This was traced to here.

libgcc/ChangeLog:

* config/or1k/sfp-machine.h (FP_HANDLE_EXCEPTIONS): Remove statement clearing existing exceptions.

---
 libgcc/config/or1k/sfp-machine.h | 1 -
 1 file changed, 1 deletion(-)
libgcc/config/or1k/sfp-machine.h +0 -1
index 162c6bc5326..c804270fb3c 100644
@@ -73,7 +73,6 @@ do {								\
 do {								\
   if (__builtin_expect (_fex, 0))				\
     {								\
-      _fpcsr &= ~FP_EX_ALL;					\
       _fpcsr |= _fex;						\
       __asm__ volatile ("l.mtspr r0,%0,20" : : "r" (_fpcsr));	\
     }								\
Signature · 1 line
2.39.1