I have been trying to get the FreeBSD libm testsuite to pass on AArch64
and it expects certain long double math functions to raise FE_INVALID for
bad inputs. However, the compiler-rt soft-float builtins do not raise
FE_INVALID for cases such as inf-inf, 0/0 etc. so the tests fail.
This patch extends the existing support for raising FE_INEXACT to also
handle FE_INVALID/FE_DIVBYZERO for most cases listed in IEEE-754-2019 7.2
and 7.3. I am not a floating-point expert so I may have missed some cases,
or might have got something wrong but this change allows most of the
FreeBSD libm long double tests to pass on AArch64.
Please could the comment be moved to before ARM_INEXACT. It can be worked out from the 0x1000 what it is referring to, but I think having it above the value would avoid suspicion of ARM_INVALID and ARM_DIVBYZERO.
I'm with you that it looks wrong. From my reading of the Arm ARM 0x1000 (12 IXE) enables hardware trapping of inexact rounding (if hardware supports it), which would be unlikely to be useful given that __fe_raise_inexact is called when adding/subtracting floating point in software.