From 302e31aff5e24ac1b8a057d93227cd9e00778135 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Wed, 11 Sep 2024 23:04:02 -0700 Subject: [PATCH] amd64: Support cmps repnz prefix and non-repeating cases --- priv/guest_amd64_toIR.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/priv/guest_amd64_toIR.c b/priv/guest_amd64_toIR.c index 5ec0a3a58..e76d3395e 100644 --- a/priv/guest_amd64_toIR.c +++ b/priv/guest_amd64_toIR.c @@ -20991,6 +20991,22 @@ Long dis_ESC_NONE ( dres->whatNext = Dis_StopHere; return delta; } + /* F2 A6/A7: repe cmps/repnz cmps{w,l,q} */ + if (!haveF3(pfx) && haveF2(pfx)) { + if (opc == 0xA6) + sz = 1; + dis_REP_op ( dres, AMD64CondNZ, dis_CMPS, sz, + guest_RIP_curr_instr, + guest_RIP_bbstart+delta, "repne cmps", pfx ); + dres->whatNext = Dis_StopHere; + return delta; + } + if (!haveF3(pfx) && !haveF2(pfx)) { + if (opc == 0xA6) + sz = 1; + dis_string_op( dis_CMPS, sz, "cmps", pfx ); + return delta; + } goto decode_failure; case 0xAA: