Page MenuHomeFreeBSD

Save all fpcr/fpsr bits in the AArch64 fenv_t
ClosedPublic

Authored by arichardson on Mar 9 2021, 8:02 PM.
Tags
None
Referenced Files
F156612576: D29160.id.diff
Fri, May 15, 3:04 AM
Unknown Object (File)
Mon, May 4, 5:04 PM
Unknown Object (File)
Sat, May 2, 3:47 AM
Unknown Object (File)
Fri, May 1, 11:55 AM
Unknown Object (File)
Fri, May 1, 11:54 AM
Unknown Object (File)
Fri, May 1, 10:36 AM
Unknown Object (File)
Fri, May 1, 8:24 AM
Unknown Object (File)
Thu, Apr 30, 7:34 AM
Subscribers

Details

Summary

The existing code masked off all bits that it didn't know about. To be
future-proof, we should save and restore the entire fpcr/fpsr registers.
Additionally, the existing fesetenv() was incorrectly setting the rounding
mode in fpsr instead of fpcr.

This patch stores fpcr in the high 32 bits of fenv_t and fpsr in the low
bits instead of trying to interleave them in a single 32-bit field.

Technically, this is an ABI break if you re-compile parts of your code or
pass a fenv_t between DSOs that were compiled with different versions
of fenv.h. However, I believe we should fix this since the existing code
was broken and passing fenv_t across DSOs should rarely happen.

Diff Detail

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

Event Timeline

I think this level of ABI breakage probably is ok. At least the size of the type hasn't changed.

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