Page MenuHomeFreeBSD

AArch64: Don't set flush-subnormals-to-zero flag on startup
ClosedPublic

Authored by arichardson on Feb 26 2021, 12:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 31, 9:58 AM
Unknown Object (File)
Sat, Oct 26, 1:56 AM
Unknown Object (File)
Sun, Oct 20, 8:51 AM
Unknown Object (File)
Sun, Oct 20, 5:33 AM
Unknown Object (File)
Sun, Oct 20, 5:31 AM
Unknown Object (File)
Oct 1 2024, 1:43 PM
Unknown Object (File)
Sep 23 2024, 11:04 PM
Unknown Object (File)
Sep 18 2024, 12:13 AM
Subscribers

Details

Summary

This flag has been set on startup since 65618fdda0f272a823e6701966421bdca0efa301.
However, This causes some of the math-related tests to fail as they report
zero instead of a tiny number. This fixes at least
/usr/tests/lib/msun/ldexp_test and possibly others.
Additionally, setting this flag prevents printf() from printing subnormal
numbers in decimal form.
See also https://www.openwall.com/lists/musl/2021/02/26/1

PR: 253847

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/arm64/arm64/vm_machdep.c
58

I just re-ran the lib/msun tests with this set to zero and this results in one fewer failure. Why is this non-default flag being set?

My original idea was to do as much as possible for armv7. Primarily because it has been working on this platform for a long time. My bad is that I didn't remember that flush-to-zero mode was chosen because the little version of armv7 VFP may need software emulation for rounding to denormal values, so we chose the IEEE 754 incompatible mode.

sys/arm64/arm64/vm_machdep.c
58

Bad is that I'm unable to determine which value of DN should be compatible with IEEE 754 standard. By my reading, IEEE754 allows both variants.

This revision is now accepted and ready to land.Mar 1 2021, 12:13 PM