[1/4] alpha: add the denormal trap enable bit to FE_NOMASK_ENV
Checks
| Context |
Check |
Description |
| redhat-pt-bot/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
| linaro-tcwg-bot/tcwg_glibc_build--master-arm |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 |
success
|
Test passed
|
| linaro-tcwg-bot/tcwg_glibc_check--master-arm |
success
|
Test passed
|
Commit Message
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(-)
Comments
On 03/08/26 20:55, Matt Turner wrote:
> 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.
LGTM, thanks.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
> ---
> 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. */
@@ -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. */