[32BITS] Added 66 06/07 and 66 1E/1F opcodes ([ARM64_DYNAREC] too)

This commit is contained in:
ptitSeb 2023-10-24 16:59:40 +02:00
parent e9a2f9ff62
commit 12c40a5b80
2 changed files with 66 additions and 0 deletions

View File

@ -83,6 +83,25 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
emit_add16(dyn, ninst, x1, x2, x3, x4);
BFIx(xRAX, x1, 0, 16);
break;
case 0x06:
if(rex.is32bits) {
INST_NAME("PUSH ES");
LDRH_U12(x1, xEmu, offsetof(x64emu_t, segs[_ES]));
PUSH1_32(x1);
} else {
DEFAULT;
}
break;
case 0x07:
if(rex.is32bits) {
INST_NAME("POP ES");
POP1_32(x1);
STRH_U12(x1, xEmu, offsetof(x64emu_t, segs[_ES]));
STRw_U12(xZR, xEmu, offsetof(x64emu_t, segs_serial[_ES]));
} else {
DEFAULT;
}
break;
case 0x09:
INST_NAME("OR Ew, Gw");
@ -176,6 +195,25 @@ uintptr_t dynarec64_66(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
emit_sbb16(dyn, ninst, x1, x2, x3, x4);
BFIx(xRAX, x1, 0, 16);
break;
case 0x1E:
if(rex.is32bits) {
INST_NAME("PUSH DS");
LDRH_U12(x1, xEmu, offsetof(x64emu_t, segs[_DS]));
PUSH1_32(x1);
} else {
DEFAULT;
}
break;
case 0x1F:
if(rex.is32bits) {
INST_NAME("POP DS");
POP1_32(x1);
STRH_U12(x1, xEmu, offsetof(x64emu_t, segs[_DS]));
STRw_U12(xZR, xEmu, offsetof(x64emu_t, segs_serial[_DS]));
} else {
DEFAULT;
}
break;
case 0x21:
INST_NAME("AND Ew, Gw");

View File

@ -112,6 +112,20 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
GO(0x28, sub) /* SUB 0x29 ~> 0x2D */
GO(0x30, xor) /* XOR 0x31 ~> 0x35 */
case 0x06: /* PUSH ES */
if(!rex.is32bits) {
return 0;
}
Push32(emu, emu->segs[_ES]); // even if a segment is a 16bits, a 32bits push/pop is done
break;
case 0x07: /* POP ES */
if(!rex.is32bits) {
return 0;
}
emu->segs[_ES] = Pop32(emu); // no check, no use....
emu->segs_serial[_ES] = 0;
break;
case 0x0F: /* more opcdes */
#ifdef TEST_INTERPRETER
return Test660F(test, rex, addr);
@ -119,6 +133,20 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
return Run660F(emu, rex, addr);
#endif
case 0x1E: /* PUSH DS */
if(!rex.is32bits) {
return 0;
}
Push32(emu, emu->segs[_DS]); // even if a segment is a 16bits, a 32bits push/pop is done
break;
case 0x1F: /* POP DS */
if(!rex.is32bits) {
return 0;
}
emu->segs[_DS] = Pop32(emu); // no check, no use....
emu->segs_serial[_DS] = 0;
break;
case 0x39:
nextop = F8;
GETEW(0);