]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/i386: Do not apply REX to MMX operands
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 12 Aug 2024 02:58:42 +0000 (12:58 +1000)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 12 Sep 2024 06:20:33 +0000 (09:20 +0300)
Cc: qemu-stable@nongnu.org
Fixes: b3e22b2318a ("target/i386: add core of new i386 decoder")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2495
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Link: https://lore.kernel.org/r/20240812025844.58956-2-richard.henderson@linaro.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 416f2b16c02c618c0f233372ebfe343f9ee667d4)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/i386/tcg/decode-new.c.inc

index 1dfc368456a6fce161a0235491ade1e0c35a2f62..88de92ed16636641236835ae9858e665664364ef 100644 (file)
@@ -1176,7 +1176,10 @@ static bool decode_op(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode,
             op->unit = X86_OP_SSE;
         }
     get_reg:
-        op->n = ((get_modrm(s, env) >> 3) & 7) | REX_R(s);
+        op->n = ((get_modrm(s, env) >> 3) & 7);
+        if (op->unit != X86_OP_MMX) {
+            op->n |= REX_R(s);
+        }
         break;
 
     case X86_TYPE_E:  /* ALU modrm operand */