about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-30 21:40:31 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-03-30 21:40:31 +0200
commitbde4adcdefac3e15faddd2a6a0396ded1e64f866 (patch)
treeefbfb2237056b4d052f558515eed5ab63da63e04 /src
parent3746ae9cf3b8157f547d98149568365e3a3baace (diff)
downloadbox64-bde4adcdefac3e15faddd2a6a0396ded1e64f866.tar.gz
box64-bde4adcdefac3e15faddd2a6a0396ded1e64f866.zip
Added 0F 70/C4/C5/F6 opcodes
Diffstat (limited to 'src')
-rw-r--r--src/emu/x64run0f.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/src/emu/x64run0f.c b/src/emu/x64run0f.c
index 41672c6b..d27844eb 100644
--- a/src/emu/x64run0f.c
+++ b/src/emu/x64run0f.c
@@ -38,7 +38,7 @@ int Run0F(x64emu_t *emu, rex_t rex)
     uint64_t tmp64u, tmp64u2;

     reg64_t *oped, *opgd;

     sse_regs_t *opex, *opgx, eax1;

-    mmx87_regs_t *opem, *opgm;

+    mmx87_regs_t *opem, *opgm, eam1;

 

     opcode = F8;

 

@@ -474,7 +474,15 @@ int Run0F(x64emu_t *emu, rex_t rex)
             GETGM;

             GM->q = EM->q;

             break;

-

+        case 0x70:                       /* PSHUFW Gm, Em, Ib */

+            nextop = F8;

+            GETEM(1);

+            GETGM;

+            tmp8u = F8;

+            if(EM==GM) {eam1 = *GM; EM = &eam1;}   // copy is needed

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

+                GM->uw[i] = EM->uw[(tmp8u>>(i*2))&3];

+            break;

         case 0x71:  /* GRP */

             nextop = F8;

             GETEM(1);

@@ -1058,6 +1066,20 @@ int Run0F(x64emu_t *emu, rex_t rex)
             }

             break;

 

+        case 0xC4:                       /* PINSRW Gm,Ew,Ib */

+            nextop = F8;

+            GETED(0);

+            GETGM;

+            tmp8u = F8;

+            GM->uw[tmp8u&3] = ED->word[0];   // only low 16bits

+            break;

+        case 0xC5:                       /* PEXTRW Gw,Em,Ib */

+            nextop = F8;

+            GETEM(0);

+            GETGD;

+            tmp8u = F8;

+            GD->q[0] = EM->uw[tmp8u&3];  // 16bits extract, 0 extended

+            break;

         case 0xC6:                      /* SHUFPS Gx, Ex, Ib */

             nextop = F8;

             GETEX(1);

@@ -1355,6 +1377,15 @@ int Run0F(x64emu_t *emu, rex_t rex)
                 GM->sd[i] = tmp32s + tmp32s2;

             }

             break;

+        case 0xF6:                   /* PSADBW Gm, Em */

+            nextop = F8;

+            GETEM(0);

+            GETGM;

+            tmp32u = 0;

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

+                tmp32u += (GM->ub[i]>EM->ub[i])?(GM->ub[i] - EM->ub[i]):(EM->ub[i] - GM->ub[i]);

+            GM->q = tmp32u;

+            break;

 

         case 0xF8:                   /* PSUBB Gm,Em */

             nextop = F8;