Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RV64_DYNAREC] Fixed simm12 overflow in some places ([LA64_DYNAREC] too) #2264

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/dynarec/la64/dynarec_la64_00.c
Original file line number Diff line number Diff line change
Expand Up @@ -2176,7 +2176,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags to "dont'care" state
SKIPTEST(x1);
BARRIER(BARRIER_FULL);
if (dyn->last_ip && (addr - dyn->last_ip < 0x1000)) {
if (dyn->last_ip && (addr - dyn->last_ip < 0x800)) {
ADDI_D(x2, xRIP, addr - dyn->last_ip);
} else {
TABLE64(x2, addr);
Expand Down Expand Up @@ -2211,7 +2211,7 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
BNE_MARK(xRIP, x3); // Not the expected address, exit dynarec block
POP1(xRIP); // pop the return address
if (dyn->insts[ninst].retn) {
if (dyn->insts[ninst].retn < 0x1000) {
if (dyn->insts[ninst].retn < 0x800) {
ADDI_D(xRSP, xRSP, dyn->insts[ninst].retn);
} else {
MOV64x(x3, dyn->insts[ninst].retn);
Expand Down
4 changes: 2 additions & 2 deletions src/dynarec/rv64/dynarec_rv64_00_3.c
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int
SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags to "dont'care" state
SKIPTEST(x1);
BARRIER(BARRIER_FULL);
if (dyn->last_ip && (addr - dyn->last_ip < 0x1000)) {
if (dyn->last_ip && (addr - dyn->last_ip < 0x800)) {
ADDI(x2, xRIP, addr - dyn->last_ip);
} else {
TABLE64(x2, addr);
Expand Down Expand Up @@ -953,7 +953,7 @@ uintptr_t dynarec64_00_3(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int
BNE_MARK(xRIP, x3); // Not the expected address, exit dynarec block
POP1(xRIP); // pop the return address
if (dyn->insts[ninst].retn) {
if (dyn->insts[ninst].retn < 0x1000) {
if (dyn->insts[ninst].retn < 0x800) {
ADDI(xRSP, xRSP, dyn->insts[ninst].retn);
} else {
MOV64x(x3, dyn->insts[ninst].retn);
Expand Down
Loading