about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-09 09:20:17 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-09 09:20:17 +0100
commit340bdb0b6c67ee0960f604767a8fa8e81326f92d (patch)
tree9d50e38513853e797f5ac978c7205ae398f4de3d /src
parent7f4762e63233897f055c8c7c6016548a4b82ac50 (diff)
downloadbox64-340bdb0b6c67ee0960f604767a8fa8e81326f92d.tar.gz
box64-340bdb0b6c67ee0960f604767a8fa8e81326f92d.zip
Added REX 0F C8..CF BSWAP opcodes
Diffstat (limited to 'src')
-rw-r--r--src/emu/x64run0f.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/emu/x64run0f.c b/src/emu/x64run0f.c
index 81636b4a..8fa3fdfa 100644
--- a/src/emu/x64run0f.c
+++ b/src/emu/x64run0f.c
@@ -474,6 +474,21 @@ int Run0F(x64emu_t *emu, rex_t rex)
             }

             break;

 

+        case 0xC8:

+        case 0xC9:

+        case 0xCA:

+        case 0xCB:

+        case 0xCC:

+        case 0xCD:

+        case 0xCE:

+        case 0xCF:                  /* BSWAP reg */

+            tmp8u = (opcode&7)+(rex.b<<3);

+            if(rex.w)

+                emu->regs[tmp8u].q[0] = __builtin_bswap64(emu->regs[tmp8u].q[0]);

+            else

+                emu->regs[tmp8u].dword[0] = __builtin_bswap32(emu->regs[tmp8u].dword[0]);

+            break;

+

         case 0xD1:                   /* PSRLW Gm,Em */

             nextop = F8;

             GETEM(0);