about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-09 14:00:36 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-09 14:00:36 +0100
commit32d92866e910c480459071523986cf2f447870c2 (patch)
treebb04721827ebfa505e880229e16d84ea2a7708f9 /src
parentde8a3de7aefa7f9668d60a9fb46d096d536a4de3 (diff)
downloadbox64-32d92866e910c480459071523986cf2f447870c2.tar.gz
box64-32d92866e910c480459071523986cf2f447870c2.zip
Added REX 0F 5A..5F opcodes
Diffstat (limited to 'src')
-rw-r--r--src/emu/x64run0f.c49
1 files changed, 48 insertions, 1 deletions
diff --git a/src/emu/x64run0f.c b/src/emu/x64run0f.c
index 8fa3fdfa..f30b8906 100644
--- a/src/emu/x64run0f.c
+++ b/src/emu/x64run0f.c
@@ -209,7 +209,54 @@ int Run0F(x64emu_t *emu, rex_t rex)
             for(int i=0; i<4; ++i)

                 GX->f[i] *= EX->f[i];

             break;

-

+        case 0x5A:                      /* CVTPS2PD Gx, Ex */

+            nextop = F8;

+            GETEX(0);

+            GETGX;

+            GX->d[1] = EX->f[1];

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

+            break;

+        case 0x5B:                      /* CVTDQ2PS Gx, Ex */

+            nextop = F8;

+            GETEX(0);

+            GETGX;

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

+            GX->f[1] = EX->sd[1];

+            GX->f[2] = EX->sd[2];

+            GX->f[3] = EX->sd[3];

+            break;

+        case 0x5C:                      /* SUBPS Gx, Ex */

+            nextop = F8;

+            GETEX(0);

+            GETGX;

+            for(int i=0; i<4; ++i)

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

+            break;

+        case 0x5D:                      /* MINPS Gx, Ex */

+            nextop = F8;

+            GETEX(0);

+            GETGX;

+            for(int i=0; i<4; ++i) {

+                if (isnan(GX->f[i]) || isnan(EX->f[i]) || isless(EX->f[i], GX->f[i]))

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

+            }

+            break;

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

+            nextop = F8;

+            GETEX(0);

+            GETGX;

+            for(int i=0; i<4; ++i)

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

+            break;

+        case 0x5F:                      /* MAXPS Gx, Ex */

+            nextop = F8;

+            GETEX(0);

+            GETGX;

+            for(int i=0; i<4; ++i) {

+                if (isnan(GX->f[i]) || isnan(EX->f[i]) || isgreater(EX->f[i], GX->f[i]))

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

+            }

+            break;

         case 0x60:                      /* PUNPCKLBW Gm, Em */

             nextop = F8;

             GETEM(0);