about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorYang Liu <liuyang22@iscas.ac.cn>2025-03-24 20:54:01 +0800
committerGitHub <noreply@github.com>2025-03-24 13:54:01 +0100
commitb0de73852ca218c20047cb4d76b4142a2386474b (patch)
treecf0a47d206487a8de27a653f42447e8822de93b6 /src
parentd7744ea22d511ede738bda7f2f5d7520f246aa4b (diff)
downloadbox64-b0de73852ca218c20047cb4d76b4142a2386474b.tar.gz
box64-b0de73852ca218c20047cb4d76b4142a2386474b.zip
[RV64_DYNAREC] Fixed some DD prefixed x87 opcodes (#2463)
Diffstat (limited to 'src')
-rw-r--r--src/dynarec/rv64/dynarec_rv64_dd.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/dynarec/rv64/dynarec_rv64_dd.c b/src/dynarec/rv64/dynarec_rv64_dd.c
index c21030ca..0c926106 100644
--- a/src/dynarec/rv64/dynarec_rv64_dd.c
+++ b/src/dynarec/rv64/dynarec_rv64_dd.c
@@ -150,16 +150,24 @@ uintptr_t dynarec64_DD(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
                 FSD(v1, wback, fixedaddress);
                 X87_POP_OR_FAIL(dyn, ninst, x3);
                 break;
+            case 4:
+                INST_NAME("FRSTOR m108byte");
+                MESSAGE(LOG_DUMP, "Need Optimization (FRSTOR)\n");
+                fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
+                addr = geted(dyn, addr, ninst, nextop, &ed, x4, x6, &fixedaddress, rex, NULL, 0, 0);
+                CALL(native_frstor, -1, ed, 0);
+                break;
             case 6:
-                INST_NAME("FSAVE m108byte");
+                INST_NAME("FNSAVE m108byte");
                 MESSAGE(LOG_DUMP, "Need Optimization\n");
                 fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
                 addr = geted(dyn, addr, ninst, nextop, &ed, x4, x6, &fixedaddress, rex, NULL, 0, 0);
                 CALL(native_fsave, -1, ed, 0);
+                CALL(reset_fpu, -1, 0, 0);
                 break;
             case 7:
                 INST_NAME("FNSTSW m2byte");
-                fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
+                // fpu_purgecache(dyn, ninst, 0, x1, x2, x3);
                 addr = geted(dyn, addr, ninst, nextop, &ed, x4, x6, &fixedaddress, rex, NULL, 0, 0);
                 LWU(x2, xEmu, offsetof(x64emu_t, top));
                 LHU(x3, xEmu, offsetof(x64emu_t, sw));