mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:30:52 +01:00
[PR #1383] x64_recomp: add xlat/xlatb and enter emitters (X64-RECOMP-XLAT-ENTER) #1413
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#1413
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/1383
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:feat/x64-recomp-xlat-enter📝 Commits (1)
2193b80x64_recomp: add xlat/xlatb and enter emitters📊 Changes
2 files changed (+268 additions, -1 deletions)
View changed files
➕
tests/test_x64_recomp_xlat_enter.py(+226 -0)📝
tools/x64_recomp.py(+42 -1)📄 Description
Item ID:
X64-RECOMP-XLAT-ENTERSummary
Adds AArch64 emitters for
xlat/xlatb(0xD7) andenter(0xC8) intools/x64_recomp.py:xlat/xlatb(0xD7):PRIMARY[0xD7]from("xlat", "sys")to("xlat", "")and classified"xlat"as"misc"sodecode_oneand_emit_onehandle it directly instead of rejecting it as an unhandled system instruction.AL := *(uint8_t *)(base + zero_extend(AL))wherebaseisRBX(or zero-extendedEBXunder67address-size override,ins.addrsize == 1), inserting only the low 8 bits intoRAXviabfiso the upper 56 bits ofRAXand all flags are preserved.enter imm16, imm8(0xC8):"enter"as"misc"(was already decoded byPRIMARY[0xC8] = ("enter", "iw,ib")) and added_emit_enter.RBP, snapshotsframe_temp = RSP, copiesnesting - 1lexical display frame pointers from[RBP - 8*i]and pushesframe_tempwhen(imm8 & 31) > 0, setsRBP = frame_temp, and subtracts unsignedalloc = imm16 & 0xFFFFfromRSP(supportingalloc >= 4096without overflowing ARMSUB (immediate)). Preserves all flags.Tests & Verification
upstream/main28a32e190):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_xlat_enter.py— OKpython3 -I tests/test_x64_recomp_xlat_enter.py— 1 static test OK (3 exec tests skip 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 OKtests/test_x64_recomp_xlat_enter.pyagainst unpatchedupstream/mainfails with 8 assertion failures.#1174+ all 17 other openx64_recompPR branches):tests/test_x64_recomp_xlat_enter.py: 4/4 OK (0 skipped) on native Apple M5 arm64tests/test_x64_recomp_*.pysuites combined: 132/132 OK (0 skipped)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.