about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-06-04 16:55:30 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-06-04 16:55:30 +0200
commita71e81c8423e8900893f439706e7ac4eefb4842b (patch)
tree0c370850cc0bb8d2a11208086166560abb65c55e /src
parentadd55f3cec4e1585d18b44817d40b566c3f88fc7 (diff)
downloadbox64-a71e81c8423e8900893f439706e7ac4eefb4842b.tar.gz
box64-a71e81c8423e8900893f439706e7ac4eefb4842b.zip
[DYNAREC] Fixed DD C0..C7 FFREE opcode
Diffstat (limited to 'src')
-rw-r--r--src/dynarec/dynarec_arm64_dd.c5
-rwxr-xr-xsrc/emu/x87emu_private.c10
-rwxr-xr-xsrc/emu/x87emu_private.h10
3 files changed, 15 insertions, 10 deletions
diff --git a/src/dynarec/dynarec_arm64_dd.c b/src/dynarec/dynarec_arm64_dd.c
index 7b6cf750..887cd3fc 100644
--- a/src/dynarec/dynarec_arm64_dd.c
+++ b/src/dynarec/dynarec_arm64_dd.c
@@ -48,7 +48,10 @@ uintptr_t dynarec64_DD(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
         case 0xC6:
         case 0xC7:
             INST_NAME("FFREE STx");
-            break;  // not handling Tag...
+            x87_purgecache(dyn, ninst, x1, x2, x3);
+            MOV32w(x1, nextop-0xC0);
+            CALL(fpu_do_free, -1);
+            break;
         case 0xD0:
         case 0xD1:
         case 0xD2:
diff --git a/src/emu/x87emu_private.c b/src/emu/x87emu_private.c
index cd35c116..0393ac01 100755
--- a/src/emu/x87emu_private.c
+++ b/src/emu/x87emu_private.c
@@ -9,6 +9,16 @@
 #include "x87emu_private.h"
 //#include "x64run_private.h"
 
+void fpu_do_free(x64emu_t* emu, int i)
+{
+    emu->p_regs[(emu->top+i)&7].tag = 0b11;    // empty
+    // check if all empty
+    for(int j=0; j<8; ++j)
+        if(emu->p_regs[j].tag != 0b11)
+            return;
+    emu->fpu_stack = 0;
+}
+
 void reset_fpu(x64emu_t* emu)
 {
     memset(emu->mmx87, 0, sizeof(emu->mmx87));
diff --git a/src/emu/x87emu_private.h b/src/emu/x87emu_private.h
index fc71b6d1..333d74c1 100755
--- a/src/emu/x87emu_private.h
+++ b/src/emu/x87emu_private.h
@@ -50,15 +50,7 @@ static inline void fpu_do_pop(x64emu_t* emu)
     emu->top = (emu->top+1)&7;
 }
 
-static inline void fpu_do_free(x64emu_t* emu, int i)
-{
-    emu->p_regs[(emu->top+i)&7].tag = 0b11;    // empty
-    // check if all empty
-    for(int j=0; j<8; ++j)
-        if(emu->p_regs[j].tag != 0b11)
-            return;
-    emu->fpu_stack = 0;
-}
+void fpu_do_free(x64emu_t* emu, int i);
 
 void reset_fpu(x64emu_t* emu);