Small fix for XSAVE/XRSTOR opcodes ([DYNAREC] too)
Some checks are pending
Build and Release Box64 / build (ubuntu-latest, ANDROID, Release) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, ANDROID, Trace) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, ANDROID_GLIBC, Box32) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, ANDROID_GLIBC, Release) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, ANDROID_GLIBC, StaticBuild) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, ANDROID_GLIBC, Trace) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, ARM64, Box32) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, ARM64, Release) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, ARM64, StaticBuild) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, ARM64, Trace) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, LARCH64, Box32) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, LARCH64, Release) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, LARCH64, StaticBuild) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, LARCH64, Trace) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, RISCV, Box32) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, RISCV, Release) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, RISCV, StaticBuild) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, RISCV, Trace) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, RK3588, Box32) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, RK3588, Release) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, RK3588, StaticBuild) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, RK3588, Trace) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, TERMUX, Release) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, TERMUX, Trace) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, X64, Box32) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, X64, Release) (push) Waiting to run
Build and Release Box64 / build (ubuntu-latest, X64, Trace) (push) Waiting to run

This commit is contained in:
ptitSeb 2024-11-21 12:08:43 +01:00
parent 85c6e28d47
commit c1f2304c88
6 changed files with 10 additions and 10 deletions

View File

@ -1833,7 +1833,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if(ed!=x1) {MOVx_REG(x1, ed);}
MOV32w(x2, rex.is32bits);
MOV32w(x2, rex.w?0:1);
CALL((void*)fpu_xsave, -1);
break;
case 5:
@ -1842,7 +1842,7 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
addr = geted(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if(ed!=x1) {MOVx_REG(x1, ed);}
MOV32w(x2, rex.is32bits);
MOV32w(x2, rex.w?0:1);
CALL((void*)fpu_xrstor, -1);
break;
case 7:

View File

@ -822,7 +822,7 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
addr = geted(dyn, addr, ninst, nextop, &wback, x1, x2, &fixedaddress, rex, NULL, 0, 0);
if (ed != x1) { MV(x1, ed); }
MOV32w(x2, rex.is32bits);
MOV32w(x2, rex.w?0:1);
CALL((void*)fpu_xsave, -1);
break;
case 5:
@ -831,7 +831,7 @@ uintptr_t dynarec64_0F(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
addr = geted(dyn, addr, ninst, nextop, &wback, x1, x2, &fixedaddress, rex, NULL, 0, 0);
if (ed != x1) { MV(x1, ed); }
MOV32w(x2, rex.is32bits);
MOV32w(x2, rex.w?0:1);
CALL((void*)fpu_xrstor, -1);
break;
case 7:

View File

@ -1904,7 +1904,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
addr = geted(dyn, addr, ninst, nextop, &wback, x1, x2, &fixedaddress, rex, NULL, 0, 0);
if (ed != x1) { MV(x1, ed); }
MOV32w(x2, rex.is32bits);
MOV32w(x2, rex.w?0:1);
CALL((void*)fpu_xsave, -1);
break;
case 5:
@ -1913,7 +1913,7 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
addr = geted(dyn, addr, ninst, nextop, &wback, x1, x2, &fixedaddress, rex, NULL, 0, 0);
if (ed != x1) { MV(x1, ed); }
MOV32w(x2, rex.is32bits);
MOV32w(x2, rex.w?0:1);
CALL((void*)fpu_xrstor, -1);
break;
case 7:

View File

@ -1298,12 +1298,12 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
#ifdef TEST_INTERPRETER
emu->sw.f.F87_TOP = emu->top&7;
#else
fpu_xsave(emu, ED, rex.is32bits);
fpu_xsave(emu, ED, rex.w?0:1);
#endif
break;
case 5: /* XRSTOR Ed */
_GETED(0);
fpu_xrstor(emu, ED, rex.is32bits);
fpu_xrstor(emu, ED, rex.w?0:1);
break;
case 7: /* CLFLUSH Ed */
_GETED(0);

View File

@ -444,7 +444,7 @@ void fpu_xsave_mask(x64emu_t* emu, void* ed, int is32bits, uint64_t mask)
xsave64_t *p = (xsave64_t*)ed;
xsaveheader_t *h = (xsaveheader_t*)(p+1);
uint32_t rfbm = (0b111&mask);
h->xstate_bv =(h->xstate_bv&~0b111)|rfbm;
h->xstate_bv =(h->xstate_bv&~mask)|rfbm;
h->xcomp_bv = 0;
if(h->xstate_bv&0b001) {
int top = emu->top&7;

View File

@ -366,7 +366,7 @@ void my_cpuid(x64emu_t* emu, uint32_t tmp32u)
case 0:
R_EAX = 0b111; // x87 SSE AVX saved
R_EBX = 512+64+16*16; // size of xsave/xrstor
R_ECX = 512+64+16*16; // same
R_ECX = 512+64+16*16; // maximum size of xsave area
R_EDX = 0; // more bits
break;
case 1: