From: Daniel Cederman Date: Tue, 16 Jan 2024 15:16:41 +0000 (+0100) Subject: sparc: Force calculation that raises exception X-Git-Tag: glibc-2.39~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45f7ea26c1d9145a9e024b8646592d405fb285e0;p=thirdparty%2Fglibc.git sparc: Force calculation that raises exception Use the math_force_eval() macro to force the calculation to complete and raise the exception. With this change the math/test-fenv test pass. Signed-off-by: Daniel Cederman Reviewed-by: Adhemerval Zanella --- diff --git a/sysdeps/sparc/fpu/fraiseexcpt.c b/sysdeps/sparc/fpu/fraiseexcpt.c index 26a7720ec98..642666c12aa 100644 --- a/sysdeps/sparc/fpu/fraiseexcpt.c +++ b/sysdeps/sparc/fpu/fraiseexcpt.c @@ -20,6 +20,7 @@ #include #include #include +#include int __feraiseexcept (int excepts) @@ -42,7 +43,7 @@ __feraiseexcept (int excepts) /* One example of an invalid operation is 0/0. */ __asm ("" : "=e" (d) : "0" (c.zero)); d /= c.zero; - __asm __volatile ("" : : "e" (d)); + math_force_eval (d); } /* Next: division by zero. */ @@ -50,7 +51,7 @@ __feraiseexcept (int excepts) { __asm ("" : "=e" (d) : "0" (c.one)); d /= c.zero; - __asm __volatile ("" : : "e" (d)); + math_force_eval (d); } /* Next: overflow. */ @@ -58,7 +59,7 @@ __feraiseexcept (int excepts) { __asm ("" : "=e" (d) : "0" (c.max)); d *= d; - __asm __volatile ("" : : "e" (d)); + math_force_eval (d); } /* Next: underflow. */ @@ -66,7 +67,7 @@ __feraiseexcept (int excepts) { __asm ("" : "=e" (d) : "0" (c.min)); d *= d; - __asm __volatile ("" : : "e" (d)); + math_force_eval (d); } /* Last: inexact. */ @@ -74,7 +75,7 @@ __feraiseexcept (int excepts) { __asm ("" : "=e" (d) : "0" (c.one)); d /= c.pi; - __asm __volatile ("" : : "e" (d)); + math_force_eval (d); } /* Success. */