mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:00:52 +01:00
[PR #1409] x64_recomp: give REX.W precedence over 0x66 operand-size override (X64-RECOMP-REXW-OVER-66) #1439
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1439
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1409
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/x64-recomp-rexw-over-66📝 Commits (1)
d35c866x64_recomp: give REX.W precedence over 0x66 operand-size override📊 Changes
2 files changed (+138 additions, -4 deletions)
View changed files
➕
tests/test_x64_recomp_rexw_66.py(+134 -0)📝
tools/x64_recomp.py(+4 -4)📄 Description
Item ID:
X64-RECOMP-REXW-OVER-66Summary
Fixes
REX.Wvs0x66operand-size override precedence intools/x64_recomp.py:_vsize(opsize, rexw): checksif rexw: return 8beforeif opsize: return 2per Intel SDM Vol. 2A §2.2.1.2. Previously66 48 ...decoded as 16-bit instead of 64-bit, causing66 48 B8 <imm64>(movabs) to read only 2 immediate bytes and desynchronize subsequent instructions.decode_onestate["opsize"]: setsstate["opsize"] = 0 if rexw else opsizewhile leavingins.opsize = opsizeintact for mandatory-66prefix decoders (e.g. SSE2). This ensuresIzimmediates (66 48 81,66 48 68,66 48 69, etc.) read 4 bytes instead of 2 and string ops (66 48 A5) use 8-byte element width.Tests & Verification
upstream/main(3a0af1f15):python3 -m compileall -q make_game.py tools tests— OKpython3 -I scripts/check_no_game_data.py tools/x64_recomp.py tests/test_x64_recomp_rexw_66.py— OKpython3 -I tests/test_x64_recomp_rexw_66.py -v— 2 static OK (1 exec skips cleanly without#1174runner)python3 -I tests/test_x64_recomp.py— 6 static OK (26 exec skipped)python3 -I tests/test_text_write_line_endings.py— 3/3 OKpython3 -I tests/test_ci_registration.py— 16/16 OKtests/test_x64_recomp_rexw_66.pyon unpatchedupstream/main+#1174): 2 failures, 1 error.upstream/main3a0af1f15with#1174+ all 21 other openx64_recompPR branches):tests/test_x64_recomp_rexw_66.py: 3/3 OK (0 skipped) on native Apple M5 arm64tests/test_x64_recomp_*.pysuites combined: 151/151 OK (0 skipped)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.