target/i386: Use unit not type in decode_modrm

Rather that enumerating the types that can produce
MMX operands, examine the unit.  No functional change.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/r/20240812025844.58956-3-richard.henderson@linaro.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Richard Henderson 2024-08-12 12:58:43 +10:00 committed by Paolo Bonzini
parent 416f2b16c0
commit 45230bca85
1 changed files with 4 additions and 4 deletions

View File

@ -1799,13 +1799,13 @@ static void decode_root(DisasContext *s, CPUX86State *env, X86OpEntry *entry, ui
} }
static int decode_modrm(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode, static int decode_modrm(DisasContext *s, CPUX86State *env,
X86DecodedOp *op, X86OpType type) X86DecodedInsn *decode, X86DecodedOp *op)
{ {
int modrm = get_modrm(s, env); int modrm = get_modrm(s, env);
if ((modrm >> 6) == 3) { if ((modrm >> 6) == 3) {
op->n = (modrm & 7); op->n = (modrm & 7);
if (type != X86_TYPE_Q && type != X86_TYPE_N) { if (op->unit != X86_OP_MMX) {
op->n |= REX_B(s); op->n |= REX_B(s);
} }
} else { } else {
@ -2040,7 +2040,7 @@ static bool decode_op(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode,
/* fall through */ /* fall through */
case X86_TYPE_nop: /* modrm operand decoded but not fetched */ case X86_TYPE_nop: /* modrm operand decoded but not fetched */
get_modrm: get_modrm:
decode_modrm(s, env, decode, op, type); decode_modrm(s, env, decode, op);
break; break;
case X86_TYPE_O: /* Absolute address encoded in the instruction */ case X86_TYPE_O: /* Absolute address encoded in the instruction */