about summary refs log tree commit diff stats
path: root/src/emu
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu')
-rwxr-xr-xsrc/emu/x64emu_private.h5
-rwxr-xr-xsrc/emu/x64run.c38
-rw-r--r--src/emu/x64run0f.c2
-rw-r--r--src/emu/x64run64.c4
-rw-r--r--src/emu/x64run66.c3
-rw-r--r--src/emu/x64run660f.c4
-rw-r--r--src/emu/x64run6664.c4
-rw-r--r--src/emu/x64run66d9.c5
-rw-r--r--src/emu/x64run66dd.c5
-rw-r--r--src/emu/x64run67.c4
-rw-r--r--src/emu/x64rund8.c3
-rw-r--r--src/emu/x64rund9.c5
-rw-r--r--src/emu/x64runda.c3
-rw-r--r--src/emu/x64rundb.c5
-rw-r--r--src/emu/x64rundd.c3
-rw-r--r--src/emu/x64rundf.c5
-rw-r--r--src/emu/x64runf0.c176
-rw-r--r--src/emu/x64runf20f.c4
-rw-r--r--src/emu/x64runf30f.c5
19 files changed, 131 insertions, 152 deletions
diff --git a/src/emu/x64emu_private.h b/src/emu/x64emu_private.h
index b4415673..05570965 100755
--- a/src/emu/x64emu_private.h
+++ b/src/emu/x64emu_private.h
@@ -10,11 +10,6 @@ typedef struct x64_ucontext_s x64_ucontext_t;
 #define ERR_DIVBY0  2
 #define ERR_ILLEGAL 4
 
-#ifdef DYNAREC
-#define CSTACK      32
-#define CSTACKMASK  31
-#endif
-
 typedef struct forkpty_s {
     void*    amaster;
     void*   name;
diff --git a/src/emu/x64run.c b/src/emu/x64run.c
index 0a393466..5608cc00 100755
--- a/src/emu/x64run.c
+++ b/src/emu/x64run.c
@@ -21,7 +21,7 @@
 #include "bridge.h"
 #include "signals.h"
 #ifdef DYNAREC
-#include "../dynarec/arm_lock_helper.h"
+#include "../dynarec/arm64_lock_helper.h"
 #endif
 
 #include "modrm.h"
@@ -381,15 +381,16 @@ x64emurun:
         case 0x86:                      /* XCHG Eb,Gb */
             nextop = F8;
 #ifdef DYNAREC
-            GET_EB;
+            GETEB(0);
+            GETGB;
             if((nextop&0xC0)==0xC0) { // reg / reg: no lock
                 tmp8u = GB;
                 GB = EB->byte[0];
                 EB->byte[0] = tmp8u;
             } else {
                 do {
-                    tmp8u = arm_lock_read_b(EB);
-                } while(arm_lock_write_b(EB, GB));
+                    tmp8u = arm64_lock_read_b(EB);
+                } while(arm64_lock_write_b(EB, GB));
                 GB = tmp8u;
             }
             // dynarec use need it's own mecanism
@@ -408,21 +409,26 @@ x64emurun:
         case 0x87:                      /* XCHG Ed,Gd */
             nextop = F8;
 #ifdef DYNAREC
-            GET_ED;
+            GETED(0);
+            GETGD;
             if((nextop&0xC0)==0xC0) {
-                tmp32u = GD.dword[0];
-                GD.dword[0] = ED->dword[0];
-                ED->dword[0] = tmp32u;
+                if(rex.w) {
+                    tmp64u = GD->q[0];
+                    GD->q[0] = ED->q[0];
+                    ED->q[0] = tmp64u;
+                } else {
+                    tmp32u = GD->dword[0];
+                    GD->q[0] = ED->dword[0];
+                    ED->q[0] = tmp32u;
+                }
             } else {
-                if(((uintptr_t)ED)&3)
-                {
-                    // not aligned, dont't try to "LOCK"
-                    tmp32u = ED->dword[0];
-                    ED->dword[0] = GD.dword[0];
-                    GD.dword[0] = tmp32u;
+                if(rex.w) {
+                    GD->q[0] = arm64_lock_xchg(ED, GD->q[0]);
                 } else {
-                    // XCHG is supposed to automaticaly LOCK memory bus
-                    GD.dword[0] = arm_lock_xchg(ED, GD.dword[0]);
+                    do {
+                        tmp32u = arm64_lock_read_d(ED);
+                    } while(arm64_lock_write_d(ED, GD->dword[0]));
+                    GD->q[0] = tmp32u;
                 }
             }
 #else
diff --git a/src/emu/x64run0f.c b/src/emu/x64run0f.c
index 8ad1584f..ec0048f4 100644
--- a/src/emu/x64run0f.c
+++ b/src/emu/x64run0f.c
@@ -22,7 +22,7 @@
 #include "bridge.h"

 #include "signals.h"

 #ifdef DYNAREC

-#include "../dynarec/arm_lock_helper.h"

+#include "../dynarec/arm64_lock_helper.h"

 #endif

 

 #include "modrm.h"

diff --git a/src/emu/x64run64.c b/src/emu/x64run64.c
index 20c087ac..efc90e75 100644
--- a/src/emu/x64run64.c
+++ b/src/emu/x64run64.c
@@ -19,10 +19,6 @@
 #include "x87emu_private.h"

 #include "box64context.h"

 #include "bridge.h"

-//#include "signals.h"

-#ifdef DYNAREC

-#include "../dynarec/arm_lock_helper.h"

-#endif

 

 #include "modrm.h"

 

diff --git a/src/emu/x64run66.c b/src/emu/x64run66.c
index 0eefff20..377ece8c 100644
--- a/src/emu/x64run66.c
+++ b/src/emu/x64run66.c
@@ -19,9 +19,8 @@
 #include "x87emu_private.h"

 #include "box64context.h"

 #include "bridge.h"

-//#include "signals.h"

 #ifdef DYNAREC

-#include "../dynarec/arm_lock_helper.h"

+#include "../dynarec/arm64_lock_helper.h"

 #endif

 

 #include "modrm.h"

diff --git a/src/emu/x64run660f.c b/src/emu/x64run660f.c
index db4cbe25..abcf0253 100644
--- a/src/emu/x64run660f.c
+++ b/src/emu/x64run660f.c
@@ -19,10 +19,6 @@
 #include "x87emu_private.h"

 #include "box64context.h"

 #include "bridge.h"

-//#include "signals.h"

-#ifdef DYNAREC

-#include "../dynarec/arm_lock_helper.h"

-#endif

 

 #include "modrm.h"

 

diff --git a/src/emu/x64run6664.c b/src/emu/x64run6664.c
index f3001290..c61938be 100644
--- a/src/emu/x64run6664.c
+++ b/src/emu/x64run6664.c
@@ -19,10 +19,6 @@
 #include "x87emu_private.h"

 #include "box64context.h"

 #include "bridge.h"

-//#include "signals.h"

-#ifdef DYNAREC

-#include "../dynarec/arm_lock_helper.h"

-#endif

 

 #include "modrm.h"

 

diff --git a/src/emu/x64run66d9.c b/src/emu/x64run66d9.c
index fae424ba..e355ca46 100644
--- a/src/emu/x64run66d9.c
+++ b/src/emu/x64run66d9.c
@@ -18,12 +18,7 @@
 #include "x64trace.h"

 #include "x87emu_private.h"

 #include "box64context.h"

-//#include "my_cpuid.h"

 #include "bridge.h"

-//#include "signals.h"

-#ifdef DYNAREC

-#include "../dynarec/arm_lock_helper.h"

-#endif

 

 #include "modrm.h"

 

diff --git a/src/emu/x64run66dd.c b/src/emu/x64run66dd.c
index 1ef8e93c..8b2b7326 100644
--- a/src/emu/x64run66dd.c
+++ b/src/emu/x64run66dd.c
@@ -18,12 +18,7 @@
 #include "x64trace.h"

 #include "x87emu_private.h"

 #include "box64context.h"

-//#include "my_cpuid.h"

 #include "bridge.h"

-//#include "signals.h"

-#ifdef DYNAREC

-#include "../dynarec/arm_lock_helper.h"

-#endif

 

 #include "modrm.h"

 

diff --git a/src/emu/x64run67.c b/src/emu/x64run67.c
index 1d443611..a956072a 100644
--- a/src/emu/x64run67.c
+++ b/src/emu/x64run67.c
@@ -19,10 +19,6 @@
 #include "x87emu_private.h"

 #include "box64context.h"

 #include "bridge.h"

-//#include "signals.h"

-#ifdef DYNAREC

-#include "../dynarec/arm_lock_helper.h"

-#endif

 

 #include "modrm.h"

 

diff --git a/src/emu/x64rund8.c b/src/emu/x64rund8.c
index e0f1017e..60b9e151 100644
--- a/src/emu/x64rund8.c
+++ b/src/emu/x64rund8.c
@@ -19,9 +19,6 @@
 #include "x87emu_private.h"

 #include "box64context.h"

 #include "bridge.h"

-#ifdef DYNAREC

-#include "../dynarec/arm_lock_helper.h"

-#endif

 

 #include "modrm.h"

 

diff --git a/src/emu/x64rund9.c b/src/emu/x64rund9.c
index 253204e8..b7f2df5f 100644
--- a/src/emu/x64rund9.c
+++ b/src/emu/x64rund9.c
@@ -18,12 +18,7 @@
 #include "x64trace.h"

 #include "x87emu_private.h"

 #include "box64context.h"

-//#include "my_cpuid.h"

 #include "bridge.h"

-//#include "signals.h"

-#ifdef DYNAREC

-#include "../dynarec/arm_lock_helper.h"

-#endif

 

 #include "modrm.h"

 

diff --git a/src/emu/x64runda.c b/src/emu/x64runda.c
index 65115b0c..70a60222 100644
--- a/src/emu/x64runda.c
+++ b/src/emu/x64runda.c
@@ -19,9 +19,6 @@
 #include "x87emu_private.h"

 #include "box64context.h"

 #include "bridge.h"

-#ifdef DYNAREC

-#include "../dynarec/arm_lock_helper.h"

-#endif

 

 #include "modrm.h"

 

diff --git a/src/emu/x64rundb.c b/src/emu/x64rundb.c
index 772748a6..0cd9c5dd 100644
--- a/src/emu/x64rundb.c
+++ b/src/emu/x64rundb.c
@@ -18,12 +18,7 @@
 #include "x64trace.h"

 #include "x87emu_private.h"

 #include "box64context.h"

-//#include "my_cpuid.h"

 #include "bridge.h"

-//#include "signals.h"

-#ifdef DYNAREC

-#include "../dynarec/arm_lock_helper.h"

-#endif

 

 #include "modrm.h"

 

diff --git a/src/emu/x64rundd.c b/src/emu/x64rundd.c
index 73678e2b..ce6081cc 100644
--- a/src/emu/x64rundd.c
+++ b/src/emu/x64rundd.c
@@ -19,9 +19,6 @@
 #include "x87emu_private.h"

 #include "box64context.h"

 #include "bridge.h"

-#ifdef DYNAREC

-#include "../dynarec/arm_lock_helper.h"

-#endif

 

 #include "modrm.h"

 

diff --git a/src/emu/x64rundf.c b/src/emu/x64rundf.c
index 40186287..613c90f8 100644
--- a/src/emu/x64rundf.c
+++ b/src/emu/x64rundf.c
@@ -18,12 +18,7 @@
 #include "x64trace.h"

 #include "x87emu_private.h"

 #include "box64context.h"

-//#include "my_cpuid.h"

 #include "bridge.h"

-//#include "signals.h"

-#ifdef DYNAREC

-#include "../dynarec/arm_lock_helper.h"

-#endif

 

 #include "modrm.h"

 

diff --git a/src/emu/x64runf0.c b/src/emu/x64runf0.c
index 3b027137..faf1a109 100644
--- a/src/emu/x64runf0.c
+++ b/src/emu/x64runf0.c
@@ -20,9 +20,8 @@
 #include "box64context.h"

 #include "my_cpuid.h"

 #include "bridge.h"

-//#include "signals.h"

 #ifdef DYNAREC

-#include "../dynarec/arm_lock_helper.h"

+#include "../dynarec/arm64_lock_helper.h"

 #endif

 

 #include "modrm.h"

@@ -31,9 +30,11 @@ int RunF0(x64emu_t *emu, rex_t rex)
 {

     uint8_t opcode;

     uint8_t nextop;

-    uint32_t tmp32u;

+    uint8_t tmp8u;

+    int32_t tmp32s;

+    uint32_t tmp32u, tmp32u2;

     int64_t tmp64s;

-    uint64_t tmp64u;

+    uint64_t tmp64u, tmp64u2;

     reg64_t *oped, *opgd;

 

     opcode = F8;

@@ -46,42 +47,57 @@ int RunF0(x64emu_t *emu, rex_t rex)
 

     switch(opcode) {

 #ifdef DYNAREC

-        #define GO(B, OP)                      \

-        case B+0: \

-            nextop = F8;               \

-            GETEB(0);             \

+        #define GO(B, OP)                                           \

+        case B+0:                                                   \

+            nextop = F8;                                            \

+            GETEB(0);                                               \

             GETGB;                                                  \

-            do {                \

-            tmp8u = arm_lock_read_b(EB);     \

-            tmp8u = OP##8(emu, tmp8u, GB);  \

-            } while (arm_lock_write_b(EB, tmp8u));   \

-            break;                              \

-        case B+1: \

-            nextop = F8;               \

-            GETED(0);             \

+            do {                                                    \

+                tmp8u = arm64_lock_read_b(EB);                      \

+                tmp8u = OP##8(emu, tmp8u, GB);                      \

+            } while (arm64_lock_write_b(EB, tmp8u));                \

+            break;                                                  \

+        case B+1:                                                   \

+            nextop = F8;                                            \

+            GETED(0);                                               \

             GETGD;                                                  \

-            do {                \

-            tmp32u = arm_lock_read_d(ED);     \

-            tmp32u = OP##32(emu, tmp32u, GD.dword[0]);  \

-            } while (arm_lock_write_d(ED, tmp32u));   \

-            break;                              \

-        case B+2: \

-            nextop = F8;               \

-            GETEB(0);                   \

+            if(rex.w) {                                             \

+                do {                                                \

+                    tmp64u = arm64_lock_read_dd(ED);                \

+                    tmp64u = OP##64(emu, tmp64u, GD->q[0]);         \

+                } while (arm64_lock_write_dd(ED, tmp64u));          \

+            } else {                                                \

+                do {                                                \

+                    tmp32u = arm64_lock_read_d(ED);                 \

+                    tmp32u = OP##32(emu, tmp32u, GD->dword[0]);     \

+                } while (arm64_lock_write_d(ED, tmp32u));           \

+                if(MODREG)                                          \

+                    ED->dword[1] = 0;                               \

+            }                                                       \

+            break;                                                  \

+        case B+2:                                                   \

+            nextop = F8;                                            \

+            GETEB(0);                                               \

             GETGB;                                                  \

-            GB = OP##8(emu, GB, EB->byte[0]); \

-            break;                              \

-        case B+3: \

-            nextop = F8;               \

-            GETED(0);         \

+            GB = OP##8(emu, GB, EB->byte[0]);                       \

+            break;                                                  \

+        case B+3:                                                   \

+            nextop = F8;                                            \

+            GETED(0);                                               \

             GETGD;                                                  \

-            GD.dword[0] = OP##32(emu, GD.dword[0], ED->dword[0]); \

-            break;                              \

-        case B+4: \

-            R_AL = OP##8(emu, R_AL, F8); \

-            break;                              \

-        case B+5: \

-            R_EAX = OP##32(emu, R_EAX, F32); \

+            if(rex.w)                                               \

+                GD->q[0] = OP##64(emu, GD->q[0], ED->q[0]);         \

+            else                                                    \

+                GD->q[0] = OP##32(emu, GD->dword[0], ED->dword[0]); \

+            break;                                                  \

+        case B+4:                                                   \

+            R_AL = OP##8(emu, R_AL, F8);                            \

+            break;                                                  \

+        case B+5:                                                   \

+            if(rex.w)                                               \

+                R_RAX = OP##64(emu, R_RAX, F32S64);                 \

+            else                                                    \

+                R_RAX = OP##32(emu, R_EAX, F32);                    \

             break;

 #else

         #define GO(B, OP)                                           \

@@ -157,32 +173,28 @@ int RunF0(x64emu_t *emu, rex_t rex)
                     GETED(0);

                     GETGD;

 #ifdef DYNAREC

-                    if(((uintptr_t)ED)&3) {

+                    if(rex.w)

                         do {

-                            tmp32u = ED->dword[0] & ~0xff;

-                            tmp32u |= arm_lock_read_b(ED);

-                            cmp32(emu, R_EAX, tmp32u);

+                            tmp64u = arm64_lock_read_dd(ED);

+                            cmp64(emu, R_RAX, tmp64u);

                             if(ACCESS_FLAG(F_ZF)) {

-                                tmp32s = arm_lock_write_b(ED, GD->dword[0] & 0xff);

-                                if(!tmp32s)

-                                    ED->dword[0] = GD.dword[0];

+                                tmp32s = arm64_lock_write_dd(ED, GD->q[0]);

                             } else {

-                                R_EAX = tmp32u;

+                                R_RAX = tmp64u;

                                 tmp32s = 0;

                             }

                         } while(tmp32s);

-                    } else {

+                    else

                         do {

-                            tmp32u = arm_lock_read_d(ED);

+                            tmp32u = arm64_lock_read_d(ED);

                             cmp32(emu, R_EAX, tmp32u);

                             if(ACCESS_FLAG(F_ZF)) {

-                                tmp32s = arm_lock_write_d(ED, GD.dword[0]);

+                                tmp32s = arm64_lock_write_d(ED, GD->dword[0]);

                             } else {

-                                R_EAX = tmp32u;

+                                R_RAX = tmp32u;

                                 tmp32s = 0;

                             }

                         } while(tmp32s);

-                    }

 #else

                     pthread_mutex_lock(&emu->context->mutex_lock);

                     if(rex.w) {

@@ -209,20 +221,21 @@ int RunF0(x64emu_t *emu, rex_t rex)
                     GETED(0);

                     GETGD;

 #ifdef DYNAREC

-                    if(((uintptr_t)ED)&3) {

+                    if(rex.w) {

                         do {

-                            tmp32u = ED->dword[0] & ~0xff;

-                            tmp32u |= arm_lock_read_b(ED);

-                            tmp32u2 = add32(emu, tmp32u, GD.dword[0]);

-                        } while(arm_lock_write_b(ED, tmp32u2&0xff));

-                        ED->dword[0] = tmp32u2;

+                            tmp64u = arm64_lock_read_dd(ED);

+                            tmp64u2 = add64(emu, tmp64u, GD->dword[0]);

+                        } while(arm64_lock_write_dd(ED, tmp64u2));

+                        GD->q[0] = tmp64u;

                     } else {

                         do {

-                            tmp32u = arm_lock_read_d(ED);

-                            tmp32u2 = add32(emu, tmp32u, GD.dword[0]);

-                        } while(arm_lock_write_d(ED, tmp32u2));

+                            tmp32u = arm64_lock_read_d(ED);

+                            tmp32u2 = add32(emu, tmp32u, GD->dword[0]);

+                        } while(arm64_lock_write_d(ED, tmp32u2));

+                        GD->q[0] = tmp32u;

+                        if(MODREG)

+                            ED->dword[1] = 0;

                     }

-                    GD.dword[0] = tmp32u;

 #else

                     pthread_mutex_lock(&emu->context->mutex_lock);

                     if(rex.w) {

@@ -232,7 +245,7 @@ int RunF0(x64emu_t *emu, rex_t rex)
                     } else {

                         tmp32u = add32(emu, ED->dword[0], GD->dword[0]);

                         GD->q[0] = ED->dword[0];

-                        if((nextop&0xC0)==0xC0)

+                        if(MODREG)

                             ED->q[0] = tmp32u;

                         else

                             ED->dword[0] = tmp32u;

@@ -256,15 +269,40 @@ int RunF0(x64emu_t *emu, rex_t rex)
             } else

                 tmp64u = F32S64;

 #ifdef DYNAREC

-            switch((nextop>>3)&7) {

-                case 0: do { tmp32u2 = arm_lock_read_d(ED);} while(arm_lock_write_d(ED, add32(emu, tmp32u2, tmp32u))); break;

-                case 1: do { tmp32u2 = arm_lock_read_d(ED);} while(arm_lock_write_d(ED,  or32(emu, tmp32u2, tmp32u))); break;

-                case 2: do { tmp32u2 = arm_lock_read_d(ED);} while(arm_lock_write_d(ED, adc32(emu, tmp32u2, tmp32u))); break;

-                case 3: do { tmp32u2 = arm_lock_read_d(ED);} while(arm_lock_write_d(ED, sbb32(emu, tmp32u2, tmp32u))); break;

-                case 4: do { tmp32u2 = arm_lock_read_d(ED);} while(arm_lock_write_d(ED, and32(emu, tmp32u2, tmp32u))); break;

-                case 5: do { tmp32u2 = arm_lock_read_d(ED);} while(arm_lock_write_d(ED, sub32(emu, tmp32u2, tmp32u))); break;

-                case 6: do { tmp32u2 = arm_lock_read_d(ED);} while(arm_lock_write_d(ED, xor32(emu, tmp32u2, tmp32u))); break;

-                case 7:                cmp32(emu, ED->dword[0], tmp32u); break;

+            if(rex.w) {

+                switch((nextop>>3)&7) {

+                    case 0: do { tmp64u2 = arm64_lock_read_dd(ED); tmp64u2 = add64(emu, tmp64u2, tmp64u);} while(arm64_lock_write_dd(ED, tmp64u2)); break;

+                    case 1: do { tmp64u2 = arm64_lock_read_dd(ED); tmp64u2 =  or64(emu, tmp64u2, tmp64u);} while(arm64_lock_write_dd(ED, tmp64u2)); break;

+                    case 2: do { tmp64u2 = arm64_lock_read_dd(ED); tmp64u2 = adc64(emu, tmp64u2, tmp64u);} while(arm64_lock_write_dd(ED, tmp64u2)); break;

+                    case 3: do { tmp64u2 = arm64_lock_read_dd(ED); tmp64u2 = sbb64(emu, tmp64u2, tmp64u);} while(arm64_lock_write_dd(ED, tmp64u2)); break;

+                    case 4: do { tmp64u2 = arm64_lock_read_dd(ED); tmp64u2 = and64(emu, tmp64u2, tmp64u);} while(arm64_lock_write_dd(ED, tmp64u2)); break;

+                    case 5: do { tmp64u2 = arm64_lock_read_dd(ED); tmp64u2 = sub64(emu, tmp64u2, tmp64u);} while(arm64_lock_write_dd(ED, tmp64u2)); break;

+                    case 6: do { tmp64u2 = arm64_lock_read_dd(ED); tmp64u2 = xor64(emu, tmp64u2, tmp64u);} while(arm64_lock_write_dd(ED, tmp64u2)); break;

+                    case 7:                cmp64(emu, ED->q[0], tmp64u); break;

+                }

+            } else {

+                if(MODREG)

+                    switch((nextop>>3)&7) {

+                        case 0: ED->q[0] = add32(emu, ED->dword[0], tmp64u); break;

+                        case 1: ED->q[0] =  or32(emu, ED->dword[0], tmp64u); break;

+                        case 2: ED->q[0] = adc32(emu, ED->dword[0], tmp64u); break;

+                        case 3: ED->q[0] = sbb32(emu, ED->dword[0], tmp64u); break;

+                        case 4: ED->q[0] = and32(emu, ED->dword[0], tmp64u); break;

+                        case 5: ED->q[0] = sub32(emu, ED->dword[0], tmp64u); break;

+                        case 6: ED->q[0] = xor32(emu, ED->dword[0], tmp64u); break;

+                        case 7:            cmp32(emu, ED->dword[0], tmp64u); break;

+                    }

+                else

+                    switch((nextop>>3)&7) {

+                        case 0: do { tmp32u2 = arm64_lock_read_d(ED); tmp32u2 = add32(emu, tmp32u2, tmp64u);} while(arm64_lock_write_d(ED, tmp32u2)); break;

+                        case 1: do { tmp32u2 = arm64_lock_read_d(ED); tmp32u2 =  or32(emu, tmp32u2, tmp64u);} while(arm64_lock_write_d(ED, tmp32u2)); break;

+                        case 2: do { tmp32u2 = arm64_lock_read_d(ED); tmp32u2 = adc32(emu, tmp32u2, tmp64u);} while(arm64_lock_write_d(ED, tmp32u2)); break;

+                        case 3: do { tmp32u2 = arm64_lock_read_d(ED); tmp32u2 = sbb32(emu, tmp32u2, tmp64u);} while(arm64_lock_write_d(ED, tmp32u2)); break;

+                        case 4: do { tmp32u2 = arm64_lock_read_d(ED); tmp32u2 = and32(emu, tmp32u2, tmp64u);} while(arm64_lock_write_d(ED, tmp32u2)); break;

+                        case 5: do { tmp32u2 = arm64_lock_read_d(ED); tmp32u2 = sub32(emu, tmp32u2, tmp64u);} while(arm64_lock_write_d(ED, tmp32u2)); break;

+                        case 6: do { tmp32u2 = arm64_lock_read_d(ED); tmp32u2 = xor32(emu, tmp32u2, tmp64u);} while(arm64_lock_write_d(ED, tmp32u2)); break;

+                        case 7:                cmp32(emu, ED->dword[0], tmp32u); break;

+                    }

             }

 #else

             pthread_mutex_lock(&emu->context->mutex_lock);

diff --git a/src/emu/x64runf20f.c b/src/emu/x64runf20f.c
index 7b8238a8..18ec9645 100644
--- a/src/emu/x64runf20f.c
+++ b/src/emu/x64runf20f.c
@@ -19,10 +19,6 @@
 #include "x87emu_private.h"

 #include "box64context.h"

 #include "bridge.h"

-//#include "signals.h"

-#ifdef DYNAREC

-#include "../dynarec/arm_lock_helper.h"

-#endif

 

 #include "modrm.h"

 

diff --git a/src/emu/x64runf30f.c b/src/emu/x64runf30f.c
index 9b25e73a..f18aa951 100644
--- a/src/emu/x64runf30f.c
+++ b/src/emu/x64runf30f.c
@@ -18,12 +18,7 @@
 #include "x64trace.h"

 #include "x87emu_private.h"

 #include "box64context.h"

-//#include "my_cpuid.h"

 #include "bridge.h"

-//#include "signals.h"

-#ifdef DYNAREC

-#include "../dynarec/arm_lock_helper.h"

-#endif

 

 #include "modrm.h"