Repository navigation
fix(tests): compare the floating-point exception masks with the ones the host keeps - #8287
Merged
oneandonlydean merged 2 commits intoOct 23, 2026
Merged
Conversation
12 tasks done
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
12 tasks done
12 tasks done
Contributor
|
Windows run of 9415d8f merged onto Built |
…the host keeps Under Rosetta 2 the six MXCSR exception masks always read back set: a write that unmasks an SSE exception is not kept, while the x87 masks and the other MXCSR bits are. guest_floating_point unmasked the overflow exception on both units and then expected MXCSR to equal the value it wrote, so it failed on macOS although fesetexceptflag and feclearexcept left the masks alone. The test now compares with the environment read back after the write, which on other hosts is the value written. The debt entry for the floating-point functions notes the Rosetta behaviour.
… trap checks The trap checks unmask exceptions with feenableexcept and its relatives and expect MXCSR to hold the new masks, and the enable and disable results to report the traps enabled on both units. Under Rosetta 2 MXCSR keeps its six exception masks set, so no SSE trap is ever enabled and every result reports none. The test now asks the host once whether it keeps an unmasked MXCSR exception and, where it does not, expects all six SSE masks set and no trap on both units; on other hosts the expectations are the same as before. A debt entry records that the trap functions change only the x87 masks under Rosetta.
mugurc
force-pushed
the
fix/tests-fenv-masks-rosetta
branch
from
October 22, 2026 10:09
9415d8f to
100148f
Compare
12 tasks done
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
guest_floating_point(#6985) fails on macOS with "flag updates preserve exception masks". The check unmasks the overflow exception in the x87 control word and in MXCSR, callsfesetexceptflagandfeclearexcept, and expects both to equal the values it wrote. Under Rosetta 2 the six MXCSR exception masks always read back set, so MXCSR never held the value the test wrote, although the two functions left the masks alone. Part of the macOS series announced on #1 (#1 (comment)).The trap checks that #8442 added since fail on macOS for the same reason, the first one with "enable unmasks the SSE exceptions". They unmask exceptions with
feenableexceptand its relatives, expect MXCSR to hold the new masks, and expect the enable and disable results to report the traps enabled on both units. Under Rosetta no SSE trap is ever enabled, so MXCSR keeps all six masks and every result reports none. A second commit:Tested
macOS 26.5.1, Apple M5 Max, Apple clang 21, x86-64 build under Rosetta 2. The libraries do not link on macOS without the rest of the macOS series. The first commit ran on
main3fd1cc3 with the series (ci/macos-series-2on my fork), #8279, #8284, the open macOS fixes #7524 and #7937, and three changes from #7332; the second onmain7e2ba73 with the series, which now includes #7937, and the libSceSsl change of #7332. Both commits are now onmaincc00785.0x1f80reads back0x1f80. Flush-to-zero with denormals-are-zero (0x9fc0) and rounding mode 3 (0x7f80) read back as written, and so does an x87 control word with the overflow mask cleared (0x0377).guest_floating_pointfails without this PR and passes with it, 5 runs of 5, before and after feat(libc): add the floating-point trap controls #8442's trap checks (with the second commit for those).guest_floating_pointpasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)