about summary refs log tree commit diff stats
path: root/src/emu/x64run0f.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-05 11:12:48 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-05 11:12:48 +0100
commit386479f408e4e9c0b103e511c1d23c32ae9cf4be (patch)
tree8727b9e76fc648222605ae1c6a491defccf4a5e2 /src/emu/x64run0f.c
parent0bf9a5af347778ed1e6d7f20bf684259573794be (diff)
downloadbox64-386479f408e4e9c0b103e511c1d23c32ae9cf4be.tar.gz
box64-386479f408e4e9c0b103e511c1d23c32ae9cf4be.zip
Added REX 0F 40..4F CMOVcc opcodes
Diffstat (limited to 'src/emu/x64run0f.c')
-rw-r--r--src/emu/x64run0f.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/src/emu/x64run0f.c b/src/emu/x64run0f.c
index a46e488e..c922c2d3 100644
--- a/src/emu/x64run0f.c
+++ b/src/emu/x64run0f.c
@@ -25,23 +25,7 @@
 #include "../dynarec/arm_lock_helper.h"

 #endif

 

-#define F8      *(uint8_t*)(R_RIP++)

-#define F8S     *(int8_t*)(R_RIP++)

-#define F16     *(uint16_t*)(R_RIP+=2, R_RIP-2)

-#define F32     *(uint32_t*)(R_RIP+=4, R_RIP-4)

-#define F32S    *(int32_t*)(R_RIP+=4, R_RIP-4)

-#define F64     *(uint64_t*)(R_RIP+=8, R_RIP-8)

-#define F64S    *(int64_t*)(R_RIP+=8, R_RIP-8)

-#define PK(a)   *(uint8_t*)(R_RIP+a)

-

-#define GETED oped=GetEd(emu, rex, nextop)

-#define GETGD opgd=GetGd(emu, rex, nextop)

-#define GETEB oped=GetEb(emu, rex, nextop)

-#define GETGB oped=GetGb(emu, rex, nextop)

-#define ED  oped

-#define GD  opgd

-#define EB  oped

-#define GB  oped->byte[0]

+#include "modrm.h"

 

 int Run0F(x64emu_t *emu, rex_t rex)

 {

@@ -50,10 +34,6 @@ int Run0F(x64emu_t *emu, rex_t rex)
     reg64_t *oped, *opgd;

 

     opcode = F8;

-    while(opcode>=0x40 && opcode<=0x4f) {

-        rex.rex = opcode;

-        opcode = F8;

-    }

 

     switch(opcode) {

 

@@ -66,6 +46,16 @@ int Run0F(x64emu_t *emu, rex_t rex)
             GETED;

             break;

         

+

+        GOCOND(0x40

+            , nextop = F8;

+            GETED;

+            GETGD;

+            CHECK_FLAGS(emu);

+            , if(rex.w) {GD->q[0] = ED->q[0]; } else {GD->dword[0] = ED->dword[0];}

+        )                               /* 0x40 -> 0x4F CMOVxx Gd,Ed */ // conditional move, no sign

+        

+        #undef GOCOND

         case 0xAF:                      /* IMUL Gd,Ed */

             nextop = F8;

             GETED;