cpu: lower 32-bit and 64-bit ADX instructions (ADCX, ADOX) and SETO #330
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/335"
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-21T22:33:32Z.
Change
OF) alongsideZFandCFintools/ffx_version_query.pyand lower 32-bit and 64-bitadcx,adox, andseto, preservingOFacrossadcxandCFacrossadoxwith zero-extending 32-bit writes.tests/cpu/adx.asm,tests/cpu/adx.def) and differential test (tests/cpu/adx.py) wired intoCMakeLists.txtascpu_aot_adxwith ahost_has_adx()CPUID leaf 7 EBX bit 19 check andSKIP_RETURN_CODE 77for hosts without ADX.adcx32_op,adcx64_op,adox32_op,adox64_op, and interleaved dual-carryadx_dual64) across 1,093 cases against both the native DLL and a reference model.adx->cpu_aot_adxintools/form_coverage.py(+2 BMI/ADX mnemonicsadcx/adox+seto) and document the test indocs/experiments.md.Verification
Tested on Windows 11 (VS 2022 Build Tools 17.14, MSVC 19.44, ML64 14.44, Windows SDK 10.0.26100, Python 3.12):
cmake --build --preset dev --target cpu_adx_liftedfailed with:cmake --build --preset dev --target cpu_adx_liftedsucceeded.ctest --preset dev --no-tests=error -R "^(cpu_aot_adx|cpu_aot_bmi1|cpu_aot_shift_count|cpu_aot_version_query|cpu_aot_address_size)$" -V: 5/5 passed (1093 ADX cases (ADCX, ADOX, and interleaved dual-carry chains) matched native and translated DLLs).python -B tests/form_coverage_check.py:form coverage checks passed.Evidence and follow-up
adcx,adox) of the 16-entryBMI/ADXgroup indocs/coverage/x64_zen2.tsvalongside #286 (BMI1, merged) and #287 (BMI2).Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T22:41:17Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
9a45134461ℹ️ 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-21T22:37:16Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
9a45134ℹ️ 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 Vonsek on 2026-11-21T22:46:15Z.
Updated
overflowinIMUL, count-1SHL/SHR/SAR, and the five OF-clearing BMI1 forms (ANDN,BEXTR,BLSI,BLSMSK,BLSR), and addedshl1_adox32,imul_seto32, andandn_clears_of32composition checks totests/cpu/adx.asmandtests/cpu/adx.py.Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T22:41:17Z.
Code review location:
tools/ffx_version_query.py; line 256When
setooradoxfollows an existing OF-writing instruction, it can consume staleoverflow: theIMUL, one-bit shift, and BMI1 handlers never update that variable. A Linux x64 native-versus-generated-C++ check ofmov eax, 0x40000000; shl eax, 1; seto alproduced native AL=1 but lowered AL=0; feeding the same flag intoadoxalso changed the sum. Update OF for IMUL, count-one shifts, and BMI1 forms that clear it, or reject those compositions rather than silently generating incorrect results. Add composition cases to the differential fixture so these producers are checked alongside the new consumers.Useful? React with 👍 / 👎.