[PATCH 1/4] alpha: add the denormal trap enable bit to FE_NOMASK_ENV
Matt Turner <[email protected]> Mon, 3 Aug 2026 19:55:06 -0400
| Newsgroups | gmane.comp.lib.glibc.alpha |
|---|---|
| Message-ID | <[email protected]> |
FE_NOMASK_ENV is the floating-point environment in which no exception is
masked, so it must enable every exception that FE_ALL_EXCEPT covers. On
Alpha that includes the GNU extension FE_DENORMAL, whose SWCR trap enable
bit is IEEE_TRAP_ENABLE_DNO (bit 6).
The constant only set bits 1 through 5 (INV, DZE, OVF, UNF and INE), so
after fesetenv (FE_NOMASK_ENV) a subsequent fegetexcept () returned
0x3e0000 rather than FE_ALL_EXCEPT (0x7e0000), and denormal exceptions
stayed masked. Set bit 6 as well.
Fixes math/test-fenv-return on alpha.
---
sysdeps/alpha/fpu/bits/fenv.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git ./sysdeps/alpha/fpu/bits/fenv.h ./sysdeps/alpha/fpu/bits/fenv.h
index b1135f1f0a..530f298914 100644
--- ./sysdeps/alpha/fpu/bits/fenv.h
+++ ./sysdeps/alpha/fpu/bits/fenv.h
@@ -121,7 +121,7 @@ typedef unsigned long int fenv_t;
#ifdef __USE_GNU
/* Floating-point environment where none of the exceptions are masked. */
-# define FE_NOMASK_ENV ((const fenv_t *) 0x880000000000003eUL)
+# define FE_NOMASK_ENV ((const fenv_t *) 0x880000000000007eUL)
/* Floating-point environment with (processor-dependent) non-IEEE floating
point. In this case, mapping denormals to zero. */
--
2.54.0