Repository navigation
cpu: cover eight scalar SSE translator semantics that no test observed - #577
Merged
Merged
Conversation
probe_ss copies a full XMM register with movaps, runs addss with a memory operand and cvtsi2ss from a negative dword, all of which keep the upper bits of the low quadword, and then reloads movss from memory, which clears them. It ends with comiss on equal, unordered and ordered operands in both operand orders. Each case covers a cpu_sse_aot mutation that passed every cpu_ test before.
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.
Change
This closes eight coverage gaps in the scalar SSE/SSE2 translator,
tools/cpu_sse_aot.py(#269). Each was a mutation of the translator that passed everycpu_test onmain. Only thecpu_aot_scalar_floatfixture, its check and its CMake signature list change; the translator does not.tests/cpu/scalar_float.asmgainsprobe_ss(unsigned probe_ss(void* buffer, float a, float b)):movqloads a seed quadword whose high dword is nonzero, andmovapscopies the whole register;addsswith a memory operand,cvtsi2ssfrom a negative dword in memory, andmovssfrom memory are each followed by amovqstore of the low quadword, so the high dword they keep (or, for themovssload, clear) is observed;comiss xmm1, xmm2withjp,jaandjbreturns 0, 1, 2 or 3 for equal, unordered, above and below. TheSWAP_OPERANDSbuild compares in the other order.scalar_float_check.pyadds the signatureq:qff, two known answers (equal operands, and a NaN), and a differential case witha > bthat the swapped build must change.Verification
On
19f89a5(branch on079120c), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14:It passes. In the full suite, 274 of 275 tests pass. The exception is
pixel_aot_hardware, which fails the same way onmain(reported on #408) and does not involve the CPU translators.Each mutation was applied to
tools/cpu_sse_aot.pyone at a time, followed by a rebuild and the wholecpu_family. Onmain, everycpu_test passed for each one. A control that swapped theeandneconditions was caught bycpu_aot_scalar_float, so the run does detect a broken translator. On this branch, each mutation failscpu_aot_scalar_float:movapsaddsscvtsi2ssa(above) ignores ZFb(below) also takes ZFcomisstreats an unordered result as equalcvtsi2ssmovssload keeps the old high dwordmovssloadChecklist
AI-assisted.