about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-07 20:23:59 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-07 20:23:59 +0100
commit73b2eb4a726b91ff3544c4a71457579feea115db (patch)
treec50210b64aad199590ad0c3ff851ed0bebb488bf
parent4c7cbe412835ee6a11df44eb2a324d32452047b7 (diff)
downloadbox64-73b2eb4a726b91ff3544c4a71457579feea115db.tar.gz
box64-73b2eb4a726b91ff3544c4a71457579feea115db.zip
Added a few SSE opcodes
-rw-r--r--src/emu/x64run0f.c19
-rw-r--r--src/emu/x64runf30f.c13
2 files changed, 32 insertions, 0 deletions
diff --git a/src/emu/x64run0f.c b/src/emu/x64run0f.c
index 7a6ab005..a6404967 100644
--- a/src/emu/x64run0f.c
+++ b/src/emu/x64run0f.c
@@ -66,6 +66,25 @@ int Run0F(x64emu_t *emu, rex_t rex)
             EX->q[1] = GX->q[1];

             break;

 

+        case 0x2E:                      /* UCOMISS Gx, Ex */

+            // same for now

+        case 0x2F:                      /* COMISS Gx, Ex */

+            RESET_FLAGS(emu);

+            nextop = F8;

+            GETEX(0);

+            GETGX;

+            if(isnan(GX->f[0]) || isnan(EX->f[0])) {

+                SET_FLAG(F_ZF); SET_FLAG(F_PF); SET_FLAG(F_CF);

+            } else if(isgreater(GX->f[0], EX->f[0])) {

+                CLEAR_FLAG(F_ZF); CLEAR_FLAG(F_PF); CLEAR_FLAG(F_CF);

+            } else if(isless(GX->f[0], EX->f[0])) {

+                CLEAR_FLAG(F_ZF); CLEAR_FLAG(F_PF); SET_FLAG(F_CF);

+            } else {

+                SET_FLAG(F_ZF); CLEAR_FLAG(F_PF); CLEAR_FLAG(F_CF);

+            }

+            CLEAR_FLAG(F_OF); CLEAR_FLAG(F_AF); CLEAR_FLAG(F_SF);

+            break;

+

 

         GOCOND(0x40

             , nextop = F8;

diff --git a/src/emu/x64runf30f.c b/src/emu/x64runf30f.c
index 49176b20..711f0785 100644
--- a/src/emu/x64runf30f.c
+++ b/src/emu/x64runf30f.c
@@ -66,6 +66,12 @@ int RunF30F(x64emu_t *emu, rex_t rex)
             GX->f[0] = ED->sdword[0];

         break;

 

+    case 0x58:  /* ADDSS Gx, Ex */

+        nextop = F8;

+        GETEX(0);

+        GETGX;

+        GX->f[0] += EX->f[0];

+        break;

     case 0x59:  /* MULSS Gx, Ex */

         nextop = F8;

         GETEX(0);

@@ -79,6 +85,13 @@ int RunF30F(x64emu_t *emu, rex_t rex)
         GX->d[0] = EX->f[0];

         break;

 

+    case 0x5E:  /* DIVSS Gx, Ex */

+        nextop = F8;

+        GETEX(0);

+        GETGX;

+        GX->f[0] /= EX->f[0];

+        break;

+

     case 0x6F:  /* MOVDQU Gx, Ex */

         nextop = F8;

         GETEX(0);