diff --git a/src/dynarec/arm64/dynarec_arm64_0f.c b/src/dynarec/arm64/dynarec_arm64_0f.c index e3ac683ef..813ea8bea 100644 --- a/src/dynarec/arm64/dynarec_arm64_0f.c +++ b/src/dynarec/arm64/dynarec_arm64_0f.c @@ -87,17 +87,25 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); MOV32w(x1, 0x7f); STURH_I9(x1, wback, 0); - MOV32w(x1, 0x000c); - STURH_I9(x1, wback, 2); - MOV32w(x1, 0xd000); - STURH_I9(x1, wback, 4); + if(rex.is32bits) { + MOV32w(x1, 0x3000); + STURw_I9(x1, wback, 2); + } else { + MOV64x(x1, 0xfffffe0000077000LL); + STURx_I9(x1, wback, 2); + } break; case 1: INST_NAME("SIDT Ed"); addr = geted(dyn, addr, ninst, nextop, &wback, x2, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0); MOV32w(x1, 0xfff); STURH_I9(x1, wback, 0); - STURw_I9(xZR, wback, 2); + if(rex.is32bits) { + STURw_I9(xZR, wback, 2); + } else { + MOV64x(x1, 0xfffffe0000000000LL); + STURx_I9(x1, wback, 2); + } break; case 4: INST_NAME("SMSW Ew"); diff --git a/src/emu/x64run0f.c b/src/emu/x64run0f.c index 83b60043e..d0b5900f8 100644 --- a/src/emu/x64run0f.c +++ b/src/emu/x64run0f.c @@ -101,13 +101,19 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step) switch((nextop>>3)&7) { case 0: /* SGDT Ed */ ED->word[0] = 0x7f; // dummy return... - ED->word[1] = 0x000c; - ED->word[2] = 0xd000; + if(rex.is32bits) { + *(uint32_t*)(&ED->word[1]) = 0x3000; + } else { + *(uint64_t*)(&ED->word[1]) = 0xfffffe0000077000LL; + } break; case 1: /* SIDT Ed */ ED->word[0] = 0xfff; // dummy return, like "disabled" - ED->word[1] = 0; - ED->word[2] = 0; + if(rex.is32bits) { + *(uint32_t*)(&ED->word[1]) = 0x0000; + } else { + *(uint64_t*)(&ED->word[1]) = 0xfffffe0000000000LL; + } break; case 4: /* SMSW Ew */ // dummy for now... Do I need to track CR0 state?