cpu: lower 32-bit and 64-bit BMI1 bit-manipulation instructions #282
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/286"
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-21T20:50:53Z.
Change
andn,bextr,blsi,blsmsk,blsr,tzcnt) intools/ffx_version_query.py, preserving zero-extending 32-bit writes and exact ZF/CF flag updates.tests/cpu/bmi1.asm,tests/cpu/bmi1.def) and differential test (tests/cpu/bmi1.py) wired intoCMakeLists.txtascpu_aot_bmi1, checking all 12 exports (32-bit and 64-bit) for both values and observed ZF/CF flags plus a 16-bittzcntrejection control.bmi1->cpu_aot_bmi1intools/form_coverage.py(raising BMI/ADX x64 Zen 2 form coverage from 0/16 to 6/16) 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_bmi1_liftedfailed with:cmake --build --preset dev --target cpu_bmi1_liftedsucceeded.ctest --preset dev --no-tests=error -R "^(cpu_aot_bmi1|cpu_aot_shift_count|cpu_aot_version_query|cpu_aot_address_size)$" -V: 4/4 passed (1054 binary and 136 unary BMI1 cases (values + ZF/CF) matched native and translated DLLs).python -B tests/form_coverage_check.py:form coverage checks passed.Evidence and follow-up
andn,bextr,blsi,blsmsk,blsr,tzcnt) indocs/coverage/x64_zen2.tsv; BMI2 (bzhi,mulx,pdep,pext,rorx,sarx,shlx,shrx) and ADX (adcx,adox) can follow in separate focused PRs.Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T20:56:05Z.
The new CTest invokes native BMI1 exports unconditionally. BMI1 is optional on supported x64 Windows hosts, so an older CPU can fault before producing a comparison. Please check CPUID BMI1 before calling the native fixture and register a capability skip for unsupported hosts. Preserve the differential and 16-bit rejection controls on BMI1-capable machines.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T20:53:39Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
1c2755cℹ️ 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:12:59Z.
Added a
host_has_bmi1()CPUID leaf 7 EBX bit 3 check in the portable lifted DLL before loading/invoking the native BMI1 fixture, exiting 77 when BMI1 is absent, and registeredSKIP_RETURN_CODE 77oncpu_aot_bmi1inCMakeLists.txt. Differential and 16-bit rejection controls remain unchanged on BMI1-capable hosts.