Skip to content

ISUB_R fix for ARM/RISC-V JIT#325

Merged
SChernykh merged 4 commits into
tevador:v1.xfrom
SChernykh:isub_r_fix
May 9, 2026
Merged

ISUB_R fix for ARM/RISC-V JIT#325
SChernykh merged 4 commits into
tevador:v1.xfrom
SChernykh:isub_r_fix

Conversation

@SChernykh
Copy link
Copy Markdown
Collaborator

@SChernykh SChernykh commented May 8, 2026

When src = dst and imm = 0x80000000 in ISUB_R, the JIT generated the wrong code because negating 0x80000000 (-2^31) resulted in -2^31 again, not +2^31.

Also added the test to tests.cpp to check this case (can be verified by disabling the fix in jit_compiler_a64/jit_compiler_rv64).

@SChernykh SChernykh requested a review from tevador May 8, 2026 19:42
@tevador
Copy link
Copy Markdown
Owner

tevador commented May 8, 2026

Tested and reproduced on a raspberry pi.

Just one small nitpick: please change 40 to 44 in tests.cpp on line 62 (alignment).

@SChernykh
Copy link
Copy Markdown
Collaborator Author

@tevador fixed

@SChernykh SChernykh merged commit 3babb87 into tevador:v1.x May 9, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants