about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-05-03 09:57:47 +0200
committerptitSeb <sebastien.chev@gmail.com>2022-05-03 09:57:47 +0200
commit59e367a88e3569b7bb470cf796df0f86e5207b1a (patch)
treea7167492a1be056cbda2165153ddf5b30892799a /src
parent098317ed29038cf93d891ef74fe43d409e8aef9d (diff)
downloadbox64-59e367a88e3569b7bb470cf796df0f86e5207b1a.tar.gz
box64-59e367a88e3569b7bb470cf796df0f86e5207b1a.zip
Added and fixed opcodes 66 0F 38 38..3F ([DYNAREC] too) (for #299)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/dynarec/arm64/dynarec_arm64_660f.c43
-rw-r--r--src/emu/x64run660f.c43
2 files changed, 83 insertions, 3 deletions
diff --git a/src/dynarec/arm64/dynarec_arm64_660f.c b/src/dynarec/arm64/dynarec_arm64_660f.c
index 11e4d2be..30d99383 100755
--- a/src/dynarec/arm64/dynarec_arm64_660f.c
+++ b/src/dynarec/arm64/dynarec_arm64_660f.c
@@ -439,6 +439,13 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
                     UXTL_32(q0, q1);     // 32bits->64bits

                     break;

 

+                case 0x38:

+                    INST_NAME("PMINSB Gx, Ex");  // SSE4 opcode!

+                    nextop = F8;

+                    GETEX(q1, 0, 0);

+                    GETGX(q0, 1);

+                    SMINQ_8(q0, q0, q1);

+                    break;

                 case 0x39:

                     INST_NAME("PMINSD Gx, Ex");  // SSE4 opcode!

                     nextop = F8;

@@ -446,7 +453,27 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
                     GETGX(q0, 1);

                     SMINQ_32(q0, q0, q1);

                     break;

-

+                case 0x3A:

+                    INST_NAME("PMINUW Gx, Ex");  // SSE4 opcode!

+                    nextop = F8;

+                    GETEX(q1, 0, 0);

+                    GETGX(q0, 1);

+                    UMINQ_16(q0, q0, q1);

+                    break;

+                case 0x3B:

+                    INST_NAME("PMINUD Gx, Ex");  // SSE4 opcode!

+                    nextop = F8;

+                    GETEX(q1, 0, 0);

+                    GETGX(q0, 1);

+                    UMINQ_32(q0, q0, q1);

+                    break;

+                case 0x3C:

+                    INST_NAME("PMAXSB Gx, Ex");  // SSE4 opcode!

+                    nextop = F8;

+                    GETEX(q1, 0, 0);

+                    GETGX(q0, 1);

+                    SMAXQ_8(q0, q0, q1);

+                    break;

                 case 0x3D:

                     INST_NAME("PMAXSD Gx, Ex");  // SSE4 opcode!

                     nextop = F8;

@@ -454,6 +481,20 @@ uintptr_t dynarec64_660F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int n
                     GETGX(q0, 1);

                     SMAXQ_32(q0, q0, q1);

                     break;

+                case 0x3E:

+                    INST_NAME("PMAXUW Gx, Ex");  // SSE4 opcode!

+                    nextop = F8;

+                    GETEX(q1, 0, 0);

+                    GETGX(q0, 1);

+                    UMAXQ_16(q0, q0, q1);

+                    break;

+                case 0x3F:

+                    INST_NAME("PMAXUD Gx, Ex");  // SSE4 opcode!

+                    nextop = F8;

+                    GETEX(q1, 0, 0);

+                    GETGX(q0, 1);

+                    UMAXQ_32(q0, q0, q1);

+                    break;

 

                 case 0xDB:

                     INST_NAME("AESIMC Gx, Ex");  // AES-NI

diff --git a/src/emu/x64run660f.c b/src/emu/x64run660f.c
index ac255a0f..e3b71d4b 100644
--- a/src/emu/x64run660f.c
+++ b/src/emu/x64run660f.c
@@ -477,6 +477,14 @@ int Run660F(x64emu_t *emu, rex_t rex)
                     GX->q[i] = EX->ud[i];

                 break;

 

+            case 0x38:  /* PMINSB Gx, Ex */

+                nextop = F8;

+                GETEX(0);

+                GETGX;

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

+                    if(GX->sb[i]>EX->sb[i])

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

+                break;

             case 0x39:  /* PMINSD Gx, Ex */

                 nextop = F8;

                 GETEX(0);

@@ -490,10 +498,25 @@ int Run660F(x64emu_t *emu, rex_t rex)
                 GETEX(0);

                 GETGX;

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

-                    if(GX->uw[i]<EX->uw[i])

+                    if(GX->uw[i]>EX->uw[i])

                         GX->uw[i] = EX->uw[i];

                 break;

-

+            case 0x3B:  /* PMINUD Gx, Ex */

+                nextop = F8;

+                GETEX(0);

+                GETGX;

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

+                    if(GX->ud[i]>EX->ud[i])

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

+                break;

+            case 0x3C:  /* PMAXSB Gx, Ex */

+                nextop = F8;

+                GETEX(0);

+                GETGX;

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

+                    if(GX->sb[i]<EX->sb[i])

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

+                break;

             case 0x3D:  /* PMAXSD Gx, Ex */

                 nextop = F8;

                 GETEX(0);

@@ -502,6 +525,22 @@ int Run660F(x64emu_t *emu, rex_t rex)
                     if(GX->sd[i]<EX->sd[i])

                         GX->sd[i] = EX->sd[i];

                 break;

+            case 0x3E:  /* PMAXUW Gx, Ex */

+                nextop = F8;

+                GETEX(0);

+                GETGX;

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

+                    if(GX->uw[i]<EX->uw[i])

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

+                break;

+            case 0x3F:  /* PMAXUD Gx, Ex */

+                nextop = F8;

+                GETEX(0);

+                GETGX;

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

+                    if(GX->ud[i]<EX->ud[i])

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

+                break;

 

             case 0xDB:  /* AESIMC Gx, Ex */

                 nextop = F8;