about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-05-27 10:08:46 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-05-27 10:08:46 +0200
commit1eab6a0c8e40341f7cabc02f8106cd159b1dcf99 (patch)
treef109e510bdb0f430814af77dd9af007e6e3bf8ef /src
parentfc2d50c7d30eff7286cfad69b037e73edfaae024 (diff)
downloadbox64-1eab6a0c8e40341f7cabc02f8106cd159b1dcf99.tar.gz
box64-1eab6a0c8e40341f7cabc02f8106cd159b1dcf99.zip
[INTERPRETER] Added avx (66 0F 3A) 0F opcode
Diffstat (limited to 'src')
-rw-r--r--src/emu/x64runavx660f3a.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/emu/x64runavx660f3a.c b/src/emu/x64runavx660f3a.c
index 3f0d4170..16a73027 100644
--- a/src/emu/x64runavx660f3a.c
+++ b/src/emu/x64runavx660f3a.c
@@ -69,6 +69,38 @@ uintptr_t RunAVX_660F3A(x64emu_t *emu, vex_t vex, uintptr_t addr, int *step)
 
     switch(opcode) {
 
+        case 0x0F:          // VPALIGNR GX, VX, EX, u8
+            nextop = F8;
+            GETEX(1);
+            GETGX;
+            GETVX;
+            GETGY;
+            tmp8u = F8;
+            if(tmp8u>31)
+                {GX->q[0] = GX->q[1] = 0;}
+            else
+            {
+                for (int i=0; i<16; ++i, ++tmp8u)
+                    eax1.ub[i] = (tmp8u>15)?((tmp8u>31)?0:VX->ub[tmp8u-16]):EX->ub[tmp8u];
+                GX->q[0] = eax1.q[0];
+                GX->q[1] = eax1.q[1];
+            }
+            if(vex.l) {
+                GETEY;
+                GETVY;
+                if(tmp8u>31)
+                    {GY->q[0] = GY->q[1] = 0;}
+                else
+                {
+                    for (int i=0; i<16; ++i, ++tmp8u)
+                        eax1.ub[i] = (tmp8u>15)?((tmp8u>31)?0:VY->ub[tmp8u-16]):EY->ub[tmp8u];
+                    GY->q[0] = eax1.q[0];
+                    GY->q[1] = eax1.q[1];
+                }
+            } else
+                GY->q[0] = GY->q[1] = 0;
+            break;
+
         case 0x44:    /* VPCLMULQDQ Gx, Vx, Ex, imm8 */
             nextop = F8;
             GETGX;