cpu: lower baseline 128-bit SSE/SSE2 packed conversions, compares, half moves, and scalar sqrt/min/max #382
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!382
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/382/head"
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?
@Vonsek on GitHub · 2026-11-21 23:58 UTC · original
Vonsek:ag/cpu-lower-sse2-packed-cvt→main· +446 −7 · 8 files · 5 commits · merged 2026-11-23 21:29 UTCChange
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.@chatgpt-codex-connector[bot] on GitHub · 2026-11-22 00:02 UTC · original · edited 2026-11-22 00:08 UTC
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.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-22 00:08 UTC · original
When 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 👍 / 👎.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-22 00:08 UTC · original
With 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 👍 / 👎.
@R0Y00 on GitHub · 2026-11-23 20:08 UTC · original
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.
@R0Y00 on GitHub · 2026-11-23 20:43 UTC · original
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.@R0Y00 on GitHub · 2026-11-23 20:56 UTC · original
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.@R0Y00 on GitHub · 2026-11-23 21:13 UTC · original
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.@chatgpt-codex-connector[bot] on GitHub · 2026-11-22 00:08 UTC · original · reviewed
💡 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".