From patchwork Mon Aug 12 02:58:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 818566 Delivered-To: patch@linaro.org Received: by 2002:a5d:5711:0:b0:367:895a:4699 with SMTP id a17csp1180781wrv; Sun, 11 Aug 2024 19:59:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXWidSm94BZAZgBAFLSSdluPSJa3rEFUksqUdfoeJNSwwmH+QPitqMHbo51O+W5FT96czQEsQ==@linaro.org X-Google-Smtp-Source: AGHT+IGJyn9bUvr2ooEElQL2oz7otXo9DyZmBQLsLWXaN2KnpG+1eEZebAlJtKjE15ImWyrLeWpq X-Received: by 2002:a05:6214:568d:b0:6b5:e3ba:5251 with SMTP id 6a1803df08f44-6bd78da54f9mr80589906d6.8.1723431558516; Sun, 11 Aug 2024 19:59:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723431558; cv=none; d=google.com; s=arc-20160816; b=JNnpgMI3FMi6l0/kfm6xQZynWdKlILp9xCNRX951jZzRsLYHqdVRwXd+B0JFtB1S+z dQqGrZLoiIVKR7KGWO+YBMhStITBmwYpxjSv6mQIIh35jYjaMFVyOpRL7cSMnnu9rj8K cbKIfBdDliL2xFwWR5rJqPPpWJtPi9uJqiBEL1UaNy+cRPgfpcrAakucCpl9uuvRGbyG 12Fh2q9lShJpSr9KV6DezFNXHEsL28MBPpRzigG7j78fe4asNnh76v3FRgMJkmmYtz7q UNQ9xzN4R2/AfrIl64HHzlZER8MaHOnQYI+KwkDBjLpSPNNhgTL5TBaOBGYDDXnlS/ds cGow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RRhHm135dGLBKgHTs5Bk6uiyESpFu38TL3b65HCIA00=; fh=3mEp7FusppN5Drq2PN08R8D/9xXM9YdbtG5TkJxJBiE=; b=COeaU73C2TaXNik32ezF09ojswBAr+rf7+OWaS71Pwji7XguZxZkEr2RWFCBlsDpJa QXMYOsHFolRMkasZTKTgAw4B6RKwLqMgmpr6ZHxo12+CStgvRanvCztI01bUSPCYTENK w7+2NSNolx+iRFKdMPdeR6tIWrmrCe6sx5q7pHUwIOBU4GkWsPNR2ODrLAkTq4/x8V2c gYUjn+lLnYwochKC94emhQ6xIIO+GOw2GeT8dXLzJt2BkETyGzXL54bOgjg3rm5tHfUu vJ1h6UcbtIQefRbV+anjsY4W81PyqUiJKR+MxqfkWM8g3zYZs/5RGgW1r3dHzfgtXagB ssCQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TYmYP7kE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6bd82e3596fsi51295546d6.242.2024.08.11.19.59.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 11 Aug 2024 19:59:18 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TYmYP7kE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sdLGt-0004W4-VR; Sun, 11 Aug 2024 22:58:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sdLGs-0004Nw-05 for qemu-devel@nongnu.org; Sun, 11 Aug 2024 22:58:58 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sdLGq-0003h1-Fx for qemu-devel@nongnu.org; Sun, 11 Aug 2024 22:58:57 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-710d0995e21so2371729b3a.1 for ; Sun, 11 Aug 2024 19:58:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723431535; x=1724036335; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RRhHm135dGLBKgHTs5Bk6uiyESpFu38TL3b65HCIA00=; b=TYmYP7kEiGi6Ybujhlfdcn2HdF/jG9zxqxDaxZZ3u5ps6I98Ul9+CZKQUVRXq3MdoA X+QarAwZO8xT3ocSLd7zybfS3dAdtfy9clgtE+fKg2Qz5tlevO26vZvD17ReM9FfIXMZ ubPAdStf87nUBBxzKPA5+G8w98lpD/kUPtMts0bNTTY/3oD2kU0SAy18ShLrue9SjaGc 16cHGjVgJaSa7CtvMtJUjdxuYmcQ89EJA2NZlFlH90jhdJXmkaoGKUa+ug5Wf1d+BNH3 Cf//7chCot6UoPaaECwczxp0QkK6N7UL6pPYmHlLTyGciBf1CCqwAwbSklxVBqNImwjh qq0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723431535; x=1724036335; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RRhHm135dGLBKgHTs5Bk6uiyESpFu38TL3b65HCIA00=; b=uY3Ax2e6LTe0kYXNx54zRCYOKLOTVmLu8e+/oVVsyh1YztEQIybzR+dvkMdogiOyK+ HPqP20RDRAmcr0u+c/PJrhp4+ay+WCWzUnIafkCjIgNuK6L/uu5CA557lu06HncHTYXX pwRdOzCeKo2wzQFcEicGDiWZ5RCd31pijXBQ1Bw0VwI8X4/VyHJ2+eY6Rcqhcaw7ct6Q KlmM9fK2LiEPITLZ9zFJQSd3z2ACK05utXBozbXgf60ncVT1WHUGlnrA0pLxVMQZx1wu 7gsJlx5gtynKXyW9WoD487CCeJG0Vv0OstxrWhce7KnVz9lJMjhnjhgG052mCBVeWyMD hYJw== X-Gm-Message-State: AOJu0YzaMS44l6ASsq0iJZB5AaLN3fruNJH91QkRSqwnlrInX0MARolf AaCBz0DQ2gHAWzQr7aH1vamd6X6XPdHBl6Oz4z3G1REH9sf//liYxmMQk4W1B4ZuA4vH3GRYLgX jQNk= X-Received: by 2002:a05:6a00:b56:b0:710:9d5e:8a3 with SMTP id d2e1a72fcca58-710dcaa69fbmr5541620b3a.30.1723431535076; Sun, 11 Aug 2024 19:58:55 -0700 (PDT) Received: from stoup.. ([203.30.4.111]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710e5a43b49sm2984841b3a.100.2024.08.11.19.58.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Aug 2024 19:58:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com Subject: [PATCH 2/3] target/i386: Use unit not type in decode_modrm Date: Mon, 12 Aug 2024 12:58:43 +1000 Message-ID: <20240812025844.58956-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240812025844.58956-1-richard.henderson@linaro.org> References: <20240812025844.58956-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Rather that enumerating the types that can produce MMX operands, examine the unit. No functional change. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/i386/tcg/decode-new.c.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.c.inc index 03138b3876..30be9237c3 100644 --- a/target/i386/tcg/decode-new.c.inc +++ b/target/i386/tcg/decode-new.c.inc @@ -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, - X86DecodedOp *op, X86OpType type) +static int decode_modrm(DisasContext *s, CPUX86State *env, + X86DecodedInsn *decode, X86DecodedOp *op) { int modrm = get_modrm(s, env); if ((modrm >> 6) == 3) { op->n = (modrm & 7); - if (type != X86_TYPE_Q && type != X86_TYPE_N) { + if (op->unit != X86_OP_MMX) { op->n |= REX_B(s); } } else { @@ -2040,7 +2040,7 @@ static bool decode_op(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode, /* fall through */ case X86_TYPE_nop: /* modrm operand decoded but not fetched */ get_modrm: - decode_modrm(s, env, decode, op, type); + decode_modrm(s, env, decode, op); break; case X86_TYPE_O: /* Absolute address encoded in the instruction */