cpu: lower VEX.128 saturating, multiply and compare word forms #1301
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1308"
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-24T07:26:26Z.
What
tools/cpu_vex_aot.pylowers ten more VEX.128 16-bit forms as explicit per-lane C++:vpaddsw,vpaddusw,vpsubsw,vpsubusw,vpmullw,vpmulhuw,vpmaxuw,vpminuw,vpcmpeqw,vpcmpgtw.tests/cpu/vex_words.asmaddssat_words,mul_minmax_wordsandcmp_words(register and memory sources, both compare operand orders).vex_words.defand the export list inCMakeLists.txtgain the three names.tests/cpu/vex_words_check.pycompares the three new functions, native and lifted, with an independent per-lane integer model, in addition to the existing native vs lifted comparison (same 4096 edge and random pairs, guard zones, aliasing, RCX == RDX, misaligned buffers).LOGICAL_SHIFTaltered build also swapsvpmulhuwforvpmulhwinmul_minmax_words. Its lifted DLL must match the altered model and differ from the original in at least one output.docs/experiments.md: supported forms, semantics note, new reference and control paragraphs.Why
These forms were rejected as unsupported. Semantics are those of the integer instructions: signed and unsigned clamps, signed vs unsigned multiply high, unsigned min/max, compare masks of all ones or zeros. They read no MXCSR bits, raise no exceptions and have no NaN or signed-zero cases. VEX.128 zeroes the upper YMM bits, which the profile never reads (unchanged). No constant folding is used.
Overlap with open PR #1188 (cpu/vex-pf-consumers): it changes
CMakeLists.txt(a different region, thecpu_vex_parityblock),docs/experiments.md(new section at the end),tools/ffx_version_query.py,tools/x87_lower.py,tests/cpu/vex_parity.*and x87 tests. It does not touchtools/cpu_vex_aot.pyortests/cpu/vex_words*. No textual conflict expected beyond possible adjacent-hunk context in the two shared files.Tested
Linux (this branch, commit
5bcba0cf):python3 -B tests/docs_links_check.pypassed;python3 -B tests/bidi_controls_check.pypassed.python -m py_compile tools/cpu_vex_aot.py tests/cpu/vex_words_check.pypassed.vex_words_check.check_rejected_encodings()(the Linux-runnable part) passed: 9 rejected encodings.vpmulhwvariant) were assembled with GNU as, run natively on an AVX2 host, lifted withcpu_vex_aot.lift, compiled with g++ and run through the check'sinputs(): native, lifted andreference()agree on all 4096 pairs for each function; the altered native differs from the original model in 4071 of 4096.vpmulhuwsigned,vpadduswunclamped,vpsubswunclamped,vpmaxuwsigned,vpcmpgtwunsigned,vpcmpeqwgiving 1) each fail the model comparison.Windows, not run locally:
The Windows MSVC/ML64 test was NOT run locally. The full
vex_words_check.pymain path needs ML64-assembled DLLs andctypes.windll, so it ran only in CI-style pieces above. The fixture was hand-mirrored to GNU as syntax for the Linux run, so the MASM source itself is unassembled until CI.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T07:36:06Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207) at
4f3a1320:--preset dev): 5/5 PASS (1.10s:cpu_aot_vex_words1.04s, pluscpu_aot_avx_int_regs,cpu_aot_avx_int_ymm_addsub,cpu_aot_avx_int_ymm_minmax,cpu_aot_avx_move_regs)/O2(--preset release): 5/5 PASS (1.14s, build1.88s:cpu_aot_vex_words0.84s, plus the 4 AVX suites)Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T07:36:19Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
4f3a132ℹ️ 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.