Skip to content

Commit

Permalink
[RV64_DYNAREC] Fixed a 16bit SHR pastpath edge case (#2251)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksco authored Jan 11, 2025
1 parent 93638ac commit 2b66675
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/dynarec/rv64/dynarec_rv64_66.c
Original file line number Diff line number Diff line change
Expand Up @@ -1124,9 +1124,13 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
// save an srli instruction...
wback = TO_NAT((nextop & 7) + (rex.b << 3));
u8 = (F8) & 0x1f;
SLLI(x1, wback, 48);
SRLI(x1, x1, 48 + u8);
ed = x1;
if (u8 > 15) {
ed = xZR;
} else {
SLLI(x1, wback, 48);
SRLI(x1, x1, 48 + u8);
ed = x1;
}
wb1 = 0;
EWBACK;
if (dyn->insts[ninst].nat_flags_fusion) NAT_FLAGS_OPS(ed, xZR);
Expand Down

0 comments on commit 2b66675

Please sign in to comment.