about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-12-05 21:22:13 +0100
committerptitSeb <sebastien.chev@gmail.com>2023-12-05 21:22:13 +0100
commit06961d3db5e85e04f417c3c10a5537d8261e76a9 (patch)
treef397f49e9855ca0b9e9b8db7af3821353a4bf97c /src
parentbdf2922f5d5e4f98731833dc727048a32b514902 (diff)
downloadbox64-06961d3db5e85e04f417c3c10a5537d8261e76a9.tar.gz
box64-06961d3db5e85e04f417c3c10a5537d8261e76a9.zip
[INTERPRETER] Refactored 0F A4/A5 opcodes for better readability
Diffstat (limited to 'src')
-rw-r--r--src/emu/x64run0f.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/emu/x64run0f.c b/src/emu/x64run0f.c
index 739e35b1..3470c443 100644
--- a/src/emu/x64run0f.c
+++ b/src/emu/x64run0f.c
@@ -914,14 +914,24 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
             }

             break;

         case 0xA4:                      /* SHLD Ed,Gd,Ib */

+            nextop = F8;

+            GETED(1);

+            GETGD;

+            tmp8u = F8;

+            if(rex.w)

+                ED->q[0] = shld64(emu, ED->q[0], GD->q[0], tmp8u);

+            else {

+                if(MODREG)

+                    ED->q[0] = shld32(emu, ED->dword[0], GD->dword[0], tmp8u);

+                else

+                    ED->dword[0] = shld32(emu, ED->dword[0], GD->dword[0], tmp8u);

+            }

+            break;

         case 0xA5:                      /* SHLD Ed,Gd,CL */

             nextop = F8;

-            GETED((nextop==0xA4)?1:0);

+            GETED(0);

             GETGD;

-            if(opcode==0xA4)

-                tmp8u = F8;

-            else

-                tmp8u = R_CL;

+            tmp8u = R_CL;

             if(rex.w)

                 ED->q[0] = shld64(emu, ED->q[0], GD->q[0], tmp8u);

             else {