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, Dec 12, 2:51 PM
Unknown Object (File)
Wed, Dec 11, 8:17 PM
Unknown Object (File)
Nov 19 2024, 8:46 AM
Unknown Object (File)
Nov 19 2024, 8:42 AM
Unknown Object (File)
Nov 19 2024, 7:40 AM
Unknown Object (File)
Nov 19 2024, 6:07 AM
Unknown Object (File)
Nov 19 2024, 6:07 AM
Unknown Object (File)
Nov 19 2024, 6:07 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