From 3b8ba5dfa645e267fe6a949985f1e2acdb61b2d4 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sat, 14 Sep 2024 15:21:15 +0200 Subject: Added 66 F3 0F BD opcode ([ARM64_DYNAREC] Too) --- src/emu/x64run66f30f.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/emu') diff --git a/src/emu/x64run66f30f.c b/src/emu/x64run66f30f.c index dd466ad5..4e455d7c 100644 --- a/src/emu/x64run66f30f.c +++ b/src/emu/x64run66f30f.c @@ -56,6 +56,24 @@ uintptr_t Run66F30F(x64emu_t *emu, rex_t rex, uintptr_t addr) switch(opcode) { + case 0xBD: /* LZCNT Ed,Gd */ + CHECK_FLAGS(emu); + nextop = F8; + GETEW(0); + GETGW; + 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 = EW->word[0]; + tmp8u = (tmp32u)?__builtin_clz(tmp32u<<16):16; + CONDITIONAL_SET_FLAG(tmp8u==0, F_ZF); + CONDITIONAL_SET_FLAG(tmp8u==16, F_CF); + } + GD->q[0] = tmp8u; + break; default: return 0; -- cgit 1.4.1