From patchwork Sun Sep 8 02:26:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 826437 Delivered-To: patch@linaro.org Received: by 2002:adf:a345:0:b0:367:895a:4699 with SMTP id d5csp1424969wrb; Sat, 7 Sep 2024 19:27:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVciKQ1gHZ7MPk1Q0MAR9jKCzAdX2j0LNXUWmTGobaFLBimjmIibOLFmhYLGhrSWTVi3r4hAg==@linaro.org X-Google-Smtp-Source: AGHT+IEQ08+7eh3aHhXHuS5/bEXDfdcZ8BP2klBcH1b52Cwysd1o/IxoihlQXgpU+7+Fz8G7a8Ak X-Received: by 2002:a05:622a:2a15:b0:458:14c8:3ed5 with SMTP id d75a77b69052e-45814c83f87mr93286811cf.22.1725762464994; Sat, 07 Sep 2024 19:27:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725762464; cv=none; d=google.com; s=arc-20240605; b=cmQXZ51q2UUQcfIAhjmPJfvmpulIvk28isAXyP3HL8jiMZKLD+O1XDLK283Sf6R0gk OA0KP6iZdKLhCwy1h3w4IE1UO9D1MfivQDoLFa0zhvHL4BIOtmV7pJ13dMesbRmRbkCN 3m9WAawteQnbZCMrmaGOMRWatI4faATeff2QSiv6qZKuDUjED9CRYF1UzlCHr5SeQAGW RD1q9VHIY+VygZwDXPF+kJ9NdJ8RiuQ+GE5F2nRC1MWBgIj4a6I0+OeG1pgFxackcWoQ uV15dXuE2wkxGyBIMxXx8oIyvVejEd9IhghQq4Yukqzs5iAdk62XjMk9P0SpVwUET/47 C9fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=u46fJy6WD0XvoquSXEHKk0WznnV96a8saQQEZkHCpG4=; fh=ygZYpEcIWhzezS2Faber1kIRniTU78jI+DFuNO+oyiU=; b=C2nfgGbiLCwrHP3WnBzNQLp4vjpxiWR4QVc/gc1cP969M/Gv119GimFqI73+N490oD 5a1EbGnN7fZ77DbNhvn4DHzAr1UKFodDXS41QCYFiUSS+meNiRsBUpHP7TQ5MS1rEq6t DB7zD1G3feZM2MswkBE3XB/dPVCoXHTqQ3Z1JmVvDnQkZVKRFp8DKurWSd8hSrOHwBI6 6GnzzLAPqzTLgWb6GAAdTvoc8zeLU2HMJRYds+xccSKk1XQ91IpyiuizoVARs7Y83DVl EOhXlI47EgBTMMWXd/DkcxJsO5E9QxBb0QaSGn1gJH2FkQ+Ftzsh8SY2Om02nBwqI5+z gDig==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NrRl0Vk/"; 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 d75a77b69052e-45822f8269fsi23468671cf.434.2024.09.07.19.27.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 07 Sep 2024 19:27:44 -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="NrRl0Vk/"; 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 1sn7dS-00035g-MD; Sat, 07 Sep 2024 22:26:42 -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 1sn7dQ-0002vp-N3 for qemu-devel@nongnu.org; Sat, 07 Sep 2024 22:26:40 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sn7dO-0004zK-T2 for qemu-devel@nongnu.org; Sat, 07 Sep 2024 22:26:40 -0400 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-2d86f713557so2189657a91.2 for ; Sat, 07 Sep 2024 19:26:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725762397; x=1726367197; 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=u46fJy6WD0XvoquSXEHKk0WznnV96a8saQQEZkHCpG4=; b=NrRl0Vk/vOws/9rhkUoD35GlqoGcZOJg2Ac5p4UHBX1oA/gGgnxrHoZRNW1fwHjul2 Op65kOh9M+xIM/9n4kBiUSnmmyFCdh4wg47kOYMJPK/kH+a/mV+b8Nl6XawVjsS1p/CK kSuY1Yblw1FYzENtpbbdF5oaJx0FlTvuvEOfhQyjBst055Av9gUwBoNF4fv2cQDLvYA5 yx81TQR55MHmPWa5b1rSANM6+W4nKEhqrFzIS0x6GooMMBu4G6jWmyPQn06IkArxc2lP Qk5iKHkQVnbD/E8lAdm55AfK2OgfhpK0ij6nD3Ebpm1udtAgUaPSEEdvQq2hOR1e9XjP mj8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725762397; x=1726367197; 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=u46fJy6WD0XvoquSXEHKk0WznnV96a8saQQEZkHCpG4=; b=tUJYakRauqt4MjjRQkL1aalrIMfuxrAHC8NGtzp35hbKukfCyORU4xFyz1Zhybx0mP lLtKYxjQyFNluAoXzdqDbNDMNojY1sBhvtYPo0ljz8i6pPQOmdHDY+tFqJNJsP0m4zUf mboIt6VaItvcxL863wUx7pwhz27FVt78u/kCRmXOXQaUqJfWTEDUnPxyhWN9IuJjKu0v 6cvd/Li2ahqk/HRQY/DZ8tqCrPIExzfiY8+gAjkbiJDkI9652zBpPewgz+4nxxf40mdY uWFBTd8c+xJctOfGrtCjpkVJrKeaVpcfd7rPSXCKtDeMzSfz1R3kCJuyqgZz6IUmzebg hnnQ== X-Gm-Message-State: AOJu0Yyq19oQoeFUAxNpMdz69x4py90hJqYMmnv+IWH6jE9xyG0vMwIC TmzocBmAXb+ugkPt+8cfVCGVKIK4l0pEYoknlDbQMJ358i8NTLci+IRcaMq1Q++eGUsDpCccMfu q X-Received: by 2002:a17:90a:77ca:b0:2c9:df1c:4a58 with SMTP id 98e67ed59e1d1-2dad5018dbfmr8906709a91.23.1725762397471; Sat, 07 Sep 2024 19:26:37 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dadbfe46d4sm4084019a91.1.2024.09.07.19.26.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2024 19:26:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: zhiwei_liu@linux.alibaba.com, tangtiancheng.ttc@alibaba-inc.com, liwei1518@gmail.com, bmeng.cn@gmail.com Subject: [PATCH 03/12] tcg/i386: Split out tcg_out_vex_modrm_type Date: Sat, 7 Sep 2024 19:26:23 -0700 Message-ID: <20240908022632.459477-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240908022632.459477-1-richard.henderson@linaro.org> References: <20240908022632.459477-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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 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 Helper function to handle setting of VEXL based on the type of the operation. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/i386/tcg-target.c.inc | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 9a54ef7f8d..af71a397b1 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -711,6 +711,15 @@ static void tcg_out_vex_modrm(TCGContext *s, int opc, int r, int v, int rm) tcg_out8(s, 0xc0 | (LOWREGMASK(r) << 3) | LOWREGMASK(rm)); } +static void tcg_out_vex_modrm_type(TCGContext *s, int opc, + int r, int v, int rm, TCGType type) +{ + if (type == TCG_TYPE_V256) { + opc |= P_VEXL; + } + tcg_out_vex_modrm(s, opc, r, v, rm); +} + /* Output an opcode with a full "rm + (index<