Skip to content

Commit

Permalink
[ARM64_DYNAREC] Added unaligned code for F3 0F 7F opcode
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Jan 15, 2025
1 parent 72df0bd commit 8c71178
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 14 additions & 2 deletions src/dynarec/arm64/dynarec_arm64_f30f.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,20 @@ uintptr_t dynarec64_F30F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
v1 = sse_get_reg_empty(dyn, ninst, x1, (nextop&7) + (rex.b<<3));
VMOVQ(v1, v0);
} else {
addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
VST128(v0, ed, fixedaddress);
IF_UNALIGNED(ip) {
addr = geted(dyn, addr, ninst, nextop, &wback, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if(wback!=x1) {
MOVx_REG(x1, wback);
wback = x1;
}
for(int i=0; i<16; ++i) {
VST1_8(v0, i, wback);
ADDx_U12(wback, wback, 1);
}
} else {
addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
VST128(v0, ed, fixedaddress);
}
SMWRITE2();
}
break;
Expand Down
4 changes: 2 additions & 2 deletions src/libtools/signals.c
Original file line number Diff line number Diff line change
Expand Up @@ -1557,9 +1557,9 @@ void my_box64signalhandler(int32_t sig, siginfo_t* info, void * ucntx)
old_pc_i = 0;
uint8_t* x64 = (uint8_t*)x64pc;
if(db)
printf_log(LOG_INFO, "Special unalinged case fixed @%p, opcode=%08x (addr=%p, db=%p, x64pc=%p[%02hhX %02hhX %02hhX %02hhX %02hhX])\n", pc, *(uint32_t*)pc, addr, db, x64pc, x64[0], x64[1], x64[2], x64[3], x64[4], x64[5]);
printf_log(LOG_INFO, "Special unaligned case fixed @%p, opcode=%08x (addr=%p, db=%p, x64pc=%p[%02hhX %02hhX %02hhX %02hhX %02hhX])\n", pc, *(uint32_t*)pc, addr, db, x64pc, x64[0], x64[1], x64[2], x64[3], x64[4], x64[5]);
else
printf_log(LOG_INFO, "Special unalinged case fixed @%p, opcode=%08x (addr=%p)\n", pc, *(uint32_t*)pc, addr);
printf_log(LOG_INFO, "Special unaligned case fixed @%p, opcode=%08x (addr=%p)\n", pc, *(uint32_t*)pc, addr);
}
}
return;
Expand Down

0 comments on commit 8c71178

Please sign in to comment.