cpu_aot_x87_compare fails with an illegal instruction on CPUs without ADX #556

Closed
opened 2026-11-22 12:36:58 +00:00 by lukaslw-lab · 0 comments
lukaslw-lab commented 2026-11-22 12:36:58 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-22T12:36:58Z.


AI-assisted (Claude Code).

On a Haswell CPU (Core i7-4790K, no ADX), Windows 10 22H2 build 19045, at c4d5e8e:

ctest --preset dev --no-tests=error -R '^cpu_aot_x87_compare$' -V
OSError: [WinError -1073741795] Windows Error 0xc000001d
Export Native Translated
add_fcomi_of (from #535; adox r9d, r9d) 0xc000001d (illegal instruction) runs
the other 11 run run
  • The test passes on the windows-2025 runner, whose CPU has ADX.
  • cpu_aot_adx already handles this: it reads CPUID leaf 7 EBX bit 19 from its translated DLL and exits 77. cpu_aot_x87_compare has no such check and no SKIP_RETURN_CODE.

Proposed fix (ready on a branch, 4 files, +33/−11): move the CPUID helper from adx.py into a shared HOST_HAS_ADX constant, export it from the translated x87_compare DLL, and skip only the native add_fcomi_of without ADX. The test then runs every other check and exits 77. A broken translation still fails (control keepof as the translated DLL: 211/12230 mismatches, exit 1). On the fork's windows-2025 runner (ADX present), cpu_aot_x87_compare still passes in both Windows jobs, 219/219.

Related: #535 (adds add_fcomi_of), #548 (edits check_rejections() in the same file; no overlapping lines).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6542458288 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/562). Originally posted by [lukaslw-lab](https://github.com/lukaslw-lab) on 2026-11-22T12:36:58Z. --- _AI-assisted (Claude Code)._ On a Haswell CPU (Core i7-4790K, no ADX), Windows 10 22H2 build 19045, at `c4d5e8e`: ```powershell ctest --preset dev --no-tests=error -R '^cpu_aot_x87_compare$' -V ``` ```text OSError: [WinError -1073741795] Windows Error 0xc000001d ``` | Export | Native | Translated | |---|---|---| | `add_fcomi_of` (from #535; `adox r9d, r9d`) | `0xc000001d` (illegal instruction) | runs | | the other 11 | run | run | - The test passes on the `windows-2025` runner, whose CPU has ADX. - `cpu_aot_adx` already handles this: it reads CPUID leaf 7 EBX bit 19 from its translated DLL and exits 77. `cpu_aot_x87_compare` has no such check and no `SKIP_RETURN_CODE`. Proposed fix (ready on a branch, 4 files, +33/−11): move the CPUID helper from `adx.py` into a shared `HOST_HAS_ADX` constant, export it from the translated x87_compare DLL, and skip only the native `add_fcomi_of` without ADX. The test then runs every other check and exits 77. A broken translation still fails (control `keepof` as the translated DLL: `211/12230 mismatches`, exit 1). On the fork's `windows-2025` runner (ADX present), `cpu_aot_x87_compare` still passes in both Windows jobs, 219/219. Related: #535 (adds `add_fcomi_of`), #548 (edits `check_rejections()` in the same file; no overlapping lines).
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows#556
No description provided.