cpu: keep the jump-table unsupported-instruction control unsupported #1381
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1388"
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 Maxim-Root on 2026-11-24T10:16:34Z.
Change
cpu_aot_jump_tablesfails onmainsince #1374 (384ee4ac, "cpu: lift BSWAP in the switch translator"):tests/cpu/switch_check.pykeeps a rejection control that patches the two-byteNOTin the jump-table fixture with0f ca(BSWAP EDX) and expectsunsupported instruction. #1374 made the switch translator lift BSWAP and moved the matching control inswitch_bit_countsto XLATB, but this second control still used BSWAP. The translator now accepts it, so the check fails before the flag-consumer controls run.This PR replaces the patch bytes with
0f a2(CPUID). It is also two bytes, so the decode stream after it is unchanged. The switch translator has no CPUID lowering, and its result depends on the host processor, so it stays out of the translator's scope. The expected reason,unsupported instruction, and the other 15 controls are unchanged. Onlytests/cpu/switch_check.pychanges (one line plus a comment).The PR check did not catch this because the
prpreset does not includecpu_aot_jump_tables. Themainruns of the full suites that would have caught it were cancelled by the next pushes (concurrencygroup), so the regression has not shown up in CI yet.Refs #1374.
Verification
Windows 11 Pro 26300.9818, MSVC 14.44.35207, Python 3.12.10, at
816fb71b(main):Without this change:
AssertionError: accepted control: unsupported instruction, 0/1. The same failure occurs at7261ab67.With this change:
ctest --preset dev --no-tests=error -R '^cpu_aot_(jump_tables|switch)' -j 16: 10/10.The same filter with
--preset release(/O2): 10/10.Checklist
AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T10:33:04Z.
Review: COMMENTED
Reviewed
a2e2a905(cpu: keep the jump-table unsupported-instruction control unsupported).git diff --checkclean; 100% title-neutral.tests/cpu/switch_check.py: replaces0f ca(bswap edx, now lifted since#1374) with0f a2(cpuid), keeping the"unsupported instruction"negative control valid.py_compile tests/cpu/switch_check.pyandtests/bidi_controls_check.py(1172 tracked files): passed.a2e2a905207621ff606395950984b372b0d2e32b:--preset dev):cpu_aot_jump_tables1/1 passed (0.43s)./O2(--preset release):cpu_aot_jump_tables1/1 passed (0.43s).