cpu: lift legacy SSE2 cmppd in the SSE FP translator #1390
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1397"
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 tedin7 on 2026-11-24T10:30:04Z.
Change
Lifts the legacy SSE2 packed double compare
cmppd xmm, xmm/m128, imm8(predicates 0..7: EQ, LT, LE, UNORD, NEQ, NLT, NLE, ORD) in the SSE FP leaf translator,tools/cpu_sse_fp_aot.py. Each 64-bit lane becomes an all-ones or all-zero mask. The lowering uses the hardware_mm_cmp*_pdintrinsics on run-time operands, so NaN handling and DAZ are decided by the processor and not by C operators or the C library.imm8 >= 8(AVX-only predicates) andm128displacements that are not multiples of 16 reject at translation time. VEX/EVEXvcmppdand scalarcmpsdstay rejected. The packed single check that usedcmppdas its unsupported instruction now usescvtpd2ps, which still rejects.This is a CPU AOT change, outside the shader/SPIR-V path. No other open PR touches
tools/cpu_sse_fp_aot.pyortests/cpu/sse_fp*.AI-assisted.
Verification
Linux x86-64 (QEMU virtual CPU, not the Windows CI machine). Fixture assembled with
llvm-ml-19, linked withlld-link-19, native code run through a Windows-ABI caller, translation built withclang++-19at -O0, -O2 and -O3 (MinGWg++-Wall -Wextra clean at the same levels). Each ran the fullsse_fp_pd_check.pyentry points:py_compile,docs_links_check.py,bidi_controls_check.py,form_coverage_check.pypass;x2w_pipe.py preflightverdict OK.origin/main: the translator stops on the new fixture withunsupported instruction at RVA 0x1187: cmpeqpd xmm0,xmm1.lifted op_cmppd_4 case 0.Not run here: the MSVC build and
ctest. PR outside preset pr:ctest --preset dev -R '^cpu_aot_sse_fp(_pd)?$'(and--preset release).Evidence and follow-up
tests/cpu/sse_fp_pd_ref.py) uses integer bit patterns and exact values, written from the predicate rules, not from a host comparison.docs/experiments.mdhas a new "Packed double compare" subsection.Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T10:40:25Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
7a14701685ℹ️ 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 tedin7 on 2026-11-24T10:45:56Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T10:34:09Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207) at commit
7a147016:--preset dev):ctest --preset dev -R '^cpu_aot_sse_fp(_pd)?$' --no-tests=error --output-on-failure— 2/2 passed (cpu_aot_sse_fp7.97s,cpu_aot_sse_fp_pd22.36s)/O2(--preset release):ctest --preset release -R '^cpu_aot_sse_fp(_pd)?$' --no-tests=error --output-on-failure— 2/2 passed (cpu_aot_sse_fp7.80s,cpu_aot_sse_fp_pd21.92s)Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T10:34:21Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
7a14701ℹ️ 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 chatgpt-codex-connector[bot] on 2026-11-24T10:40:25Z.
Code review location:
tests/cpu/sse_fp_pd_check.py; line 167cmp_referencetakesalteredbeforequirk, so this fifth positional argument never selects a mutation. Every label inCMP_QUIRKSis a truthy string, which instead enablesalteredand flips the predicate by 4 whileref.comparereceivesquirk=None. Consequently, all 14 negative controls pass simply by complementing the result, even if their mutation handlers are no-ops, and the success message falsely claims the NaN, signed-zero, mask-width and DAZ controls were exercised. Passquirk=quirkso each intended wrong rule is actually evaluated.AGENTS.md reference: AGENTS.md:L171-L171
Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T10:45:56Z.
Code review location:
tests/cpu/sse_fp_pd_check.py; line 167Fixed in
0588fd7c: passedquirk=quirkexplicitly tocmp_referenceincheck_cmp_modes(all othercmp_referencecall sites checked). Verified locally that all 14 entries inCMP_QUIRKSdiverge fromquirk=Noneand Win2025cpu_aot_sse_fp(_pd)?passed 2/2 in Debug & Release/O2.upstream-sync referenced this pull request2026-11-24 16:03:19 +00:00
upstream-sync referenced this pull request2026-11-25 00:04:55 +00:00