cpu: lower baseline 128-bit SSE/SSE2 packed conversions, compares, half moves, and scalar sqrt/min/max #376
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/382"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T23:58:32Z.
Change
tools/ffx_version_query.py:0x80000000) clamping:cvtdq2ps,cvtdq2pd,cvtps2dq,cvtpd2dq,cvttps2dq,cvttpd2dq,cvtps2pd,cvtpd2pscmpps,cmppdmovaps,movapd,movdqa,movhlps,movlhps,movlps,movhps,movlpd,movhpdsqrt/min/maxpreserving upper XMM lanes:sqrtss,minss,maxss,sqrtsd,minsd,maxsdEncodingKind.LEGACYXMM forms, rejecting VEX encodings.tests/cpu/sse2_packed_cvt.{asm,def,py}, CMake targetcpu_sse2_packed_cvt_lifted, CTestcpu_aot_sse2_packed_cvt, coverage mapping intools/form_coverage.py, and documentation indocs/experiments.md.Verification
cmake --build --preset dev --target cpu_sse2_packed_cvt_lifted:ValueError: unsupported query operation at 0x1000: movdqa xmm1,[rcx]cmake --build --preset dev --target cpu_sse2_packed_cvt_liftedsucceeded with 0 warningsctest --preset dev --no-tests=error -R "^(cpu_aot_sse2_packed_cvt|cpu_aot_bmi1)$" -V: 2/2 passed (22 baseline 128-bit SSE/SSE2 conversion/compare/move/scalar cases matched native and translated DLLs+ VEXvcvtdq2psrejection control).\out\pe-env\Scripts\python.exe -B tests/form_coverage_check.py:form coverage checks passedEvidence and follow-up
SSE-grouped mnemonics and 16SSE2-grouped mnemonics indocs/coverage/x64_zen2.tsvusing source-built fixtures.Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-22T00:08:30Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
970a0d0df3ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-22T00:02:27Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
970a0d0ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T20:08:08Z.
I checked the conflict against current main. Packed conversions and scalar min/max already have MXCSR-aware paths there. Please keep those paths when updating this older branch. #985 is reviewing the overlapping CMPPS/MOVLPS/MOVHPS forms and has a pending /O2 memory-read control. The independent remainder here is the packed-double compare and the double half-memory moves (CMPPD/MOVLPD/MOVHPD), plus any new tests for main's current behavior. Please replace the old VCVTDQ2PS rejection control with a form the current profile still refuses.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T20:43:18Z.
I resolved the conflicts against the merged #985 in
1f9c6af. This keeps the shared lowerer's existing intrinsic conversion and scalar arithmetic paths. CMPPD now tests both a register source and a native aligned memory operand. The lowerer uses the existing aligned-memory and ordered-load helpers, and the refusal control now checks a CMPPD write to XMM6.ctest --preset <dev|release> --no-tests=error -R '^cpu_aot_(sse2_packed_cvt|sse_fp)$'passed 2/2 in each Windows preset. Both GitHub Windows jobs will run for the updated head.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T20:56:37Z.
Follow-up at
40ea243: the older always-nearest and scalar conditional implementations are absent. The current conversion and MINSS/MINSD paths use the existing hardware intrinsics. I added independent exact outputs for CVTPS2DQ in round-down, CVTPD2DQ in round-toward-zero, and MINSS/MINSD with DAZ. Both Windows Debug and /O2 passed. The helper saves and restores MXCSR, and lives outside the translated coverage file. I also corrected the duplicated documentation text from my previous integration commit.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T21:13:37Z.
The prior /O2 CI failed because
cpu_aot_float_shufflesstill expected legacy MOVAPD memory loads to be unsupported. I pushedbda89d7to require the new alignment-checked lowering there. The native/lifted SSE2 fixture now also checks that misaligned MOVAPD and misaligned CMPPD memory sources each raise an access violation. The shuffle, SSE2 conversion and SSE FP selections passed 3/3 in both Windows Debug and Release. The new head has fresh CI.Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-22T00:08:31Z.
Code review location:
tools/ffx_version_query.py; line 41When the caller selects round-down or round-toward-zero in MXCSR,
CVTPS2DQandCVTPD2DQmust use that mode, but this helper always rounds to nearest-even. Comparing the emitted helper with native SSE2 on Linux x86-64,1.75converts to2here versus1natively under round-down. This can silently change the lifted exports' integer results under non-default rounding modes. Use an MXCSR-aware conversion or explicitly reject unsupported modes, and include rounding-mode controls in the differential fixture.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-22T00:08:31Z.
Code review location:
tools/ffx_version_query.py; line 306With MXCSR.DAZ enabled, native scalar min/max instructions treat subnormal inputs as signed zero, but this conditional can copy the selected operand's original subnormal bits. Compiling the emitted block unoptimized on Linux x86-64,
MINSSwith float input bit patterns0x00000001and0x3f800000produces0x00000001, whereas native SSE2 produces0x00000000; the double variant has the same mismatch. This affects unoptimized generated code, including the Debug build selected by thedevpreset. Use scalar SSE intrinsics or apply DAZ normalization before selecting the result, and cover this mode in the fixture.Useful? React with 👍 / 👎.