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
F102960736: D28938.diff
Tue, Nov 19, 5:43 AM
Unknown Object (File)
Thu, Nov 14, 6:05 PM
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)
Oct 20 2024, 5:33 AM
Unknown Object (File)
Oct 20 2024, 5:31 AM
Unknown Object (File)
Oct 1 2024, 1:43 PM
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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 37406
Build 34295: arc lint + arc unit

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