about summary refs log tree commit diff stats
path: root/src/emu
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-07-19 13:31:11 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-07-19 13:31:11 +0200
commit36e5fb50ecfe4a152782c42cf49ce9d14ffc46ea (patch)
treefea4d910456e843180d930ec30cce526871d0b4f /src/emu
parent74405a8b005c03ff1be679dcc0dcf38bae030b62 (diff)
downloadbox64-36e5fb50ecfe4a152782c42cf49ce9d14ffc46ea.tar.gz
box64-36e5fb50ecfe4a152782c42cf49ce9d14ffc46ea.zip
Added F3 0F BD opcode ([DYNAREC] too) (for #27)
Diffstat (limited to 'src/emu')
-rw-r--r--src/emu/x64runf30f.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/emu/x64runf30f.c b/src/emu/x64runf30f.c
index a5e02d59..1960238e 100644
--- a/src/emu/x64runf30f.c
+++ b/src/emu/x64runf30f.c
@@ -291,6 +291,24 @@ int RunF30F(x64emu_t *emu, rex_t rex)
             }

         }

         break;

+    case 0xBD:  /* LZCNT Ed,Gd */

+        CHECK_FLAGS(emu);

+        nextop = F8;

+        GETED(0);

+        GETGD;

+        if(rex.w) {

+            tmp64u = ED->q[0];

+            tmp8u = (tmp64u)?__builtin_clzl(tmp64u):64;

+            CONDITIONAL_SET_FLAG(tmp8u==0, F_ZF);

+            CONDITIONAL_SET_FLAG(tmp8u==64, F_CF);

+        } else {

+            tmp32u = ED->dword[0];

+            tmp8u = (tmp32u)?__builtin_clz(tmp32u):32;

+            CONDITIONAL_SET_FLAG(tmp8u==0, F_ZF);

+            CONDITIONAL_SET_FLAG(tmp8u==32, F_CF);

+        }

+        GD->q[0] = tmp8u;

+        break;

 

     case 0xC2:  /* CMPSS Gx, Ex, Ib */

         nextop = F8;