Skip to content
Commit 787282de authored by Bruno Haible's avatar Bruno Haible Committed by Adhemerval Zanella
Browse files

x86: Do not raises floating-point exception traps on fesetexceptflag (BZ 30990)



According to ISO C23 (7.6.4.4), fesetexcept is supposed to set
floating-point exception flags without raising a trap (unlike
feraiseexcept, which is supposed to raise a trap if feenableexcept
was called with the appropriate argument).

The flags can be set in the 387 unit or in the SSE unit.  When we need
to clear a flag, we need to do so in both units, due to the way
fetestexcept is implemented.

When we need to set a flag, it is sufficient to do it in the SSE unit,
because that is guaranteed to not trap.  However, on i386 CPUs that have
only a 387 unit, set the flags in the 387, as long as this cannot trap.

Co-authored-by: default avatarAdhemerval Zanella <adhemerval.zanella@linaro.org>

Reviewed-by: default avatarCarlos O'Donell <carlos@redhat.com>
parent 47a9eeb9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment