From patchwork Wed Sep 11 16:50:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 827454 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp891203wrc; Wed, 11 Sep 2024 09:51:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVBdLRPCqPUORFxzxnVc08CmmphP0LiHtg2/13kMPu4dl2KfSnInlQP7nz7gsA2PktiHMK2Cw==@linaro.org X-Google-Smtp-Source: AGHT+IF5R2KjWrQpZdTH6kFIHwmPP5pkIFOlzYGSGFQNAFSx+yRiXENqT1VjHMeYqzgYptsbPTT8 X-Received: by 2002:a05:6214:540a:b0:6c3:63f7:639e with SMTP id 6a1803df08f44-6c573514f55mr1629476d6.18.1726073509515; Wed, 11 Sep 2024 09:51:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726073509; cv=none; d=google.com; s=arc-20240605; b=EJjEc0mfheb//jEMJ2mLMDJT6yKevEhobNjYZLaGKT9dWZvsTNl0fpCMeHGPn/coyU D11X4iRMjZLUox3Rb92DaxWmZCKhNNmG4LL6tgxWNdec5BjzoawqCbq/LQzgSjVXOfqD Qug9A+4upOgKPtdzrW1r2gBCaa3xqqEqOpY/gOo8JdsL6MRKrBS6Yu81cFD6S58Xc37F gSYXdGyuFPkDQ7MGRGHnCwpGQrsReoD1ZMepgk8dIC9h4o4PA6Lc5hBlH5OLF5htuz+b 0YfJN3yy7aFlyilQkxi4vOTdN73dp+hRGvOxbn53TM8f97rIpHynoYZJRtN1N/YOb2Kb 9LWQ== 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=E4LfLCCfd77AE3gIUDkv8zMuzeAX8OHemsoCsp4r7PY=; fh=gW8xxqNJ+GKzLr7OBpcms3Apqae8iNJSKgK4r5swIT4=; b=ixy6TAg/yVyOYhFdnSZU4ugg3uds5kNZX5MCoRRCwRrAq5YhIHJsuP0ZgZooQDym/q XUOLFuOCP+EQ8NwnxNmF02V9hKDfTjb1T6FjxoY/tceZujYZ6S3TDyBSySzAwfIlmPNf K0ml37XcNp+FdgzDk9K4rJ026cih2U7nahLKuIh3tyE/nkmaF12hj4x1Wkx3mZ8s53KS ZD+gAfZqH388FGCdK1ygjdaoam1T6cnyCefKu2oHpiFkqIdHS6OL3+lIe6q+owveSBZl aTsm/oNygQGMWTegcaux4HkY3IK2hE9CkHLlemIXZKTQMlhpxV3YSUWJ6jQSkaneomgf HrKw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yn+TF8iF; 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-6c53476fb8fsi105214796d6.217.2024.09.11.09.51.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 09:51:49 -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=Yn+TF8iF; 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 1soQYR-0001xC-TX; Wed, 11 Sep 2024 12:50:55 -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 1soQYQ-0001rn-Al for qemu-devel@nongnu.org; Wed, 11 Sep 2024 12:50:54 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1soQYO-0003eC-8M for qemu-devel@nongnu.org; Wed, 11 Sep 2024 12:50:54 -0400 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-7db174f9050so30642a12.3 for ; Wed, 11 Sep 2024 09:50:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726073451; x=1726678251; 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=E4LfLCCfd77AE3gIUDkv8zMuzeAX8OHemsoCsp4r7PY=; b=Yn+TF8iFS0O+5Vw/6QXmmUH33fyrxlY5MKmAAd0rXtonfk0vnzDGqyIkltkk5QouN5 boYtZmp1DvIgu5mAI9MAomgpIUVOlPhDTib9dU1KJg0w7WPr5o30H//e0eK5exx18u3r 0+QDqyKv+ujBeY0QSyECAZxDKNggetU+3OWEwu0gRjsVhmeaLYYW17zc8Gjm5auzVgF2 1g0qH19rmPN9G5Gy6+Gw7n0LlAKtybIdyQ+gcpRGVkEg1B+3lHjY1U3NUzg6vuYMKLvO u5z4d8a69YaNxz9W5e0+rbOLqekxc0OZPiWhnPPyl7GCwxPtRpsuPDybomRq7w6hEOxj ojig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726073451; x=1726678251; 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=E4LfLCCfd77AE3gIUDkv8zMuzeAX8OHemsoCsp4r7PY=; b=d2QYW8iM4zZ+wPsxa64iApYMb1vl8mBjShbyZx6xLTve8jWOK7Zkn9+DBUoFZbDwU0 wxY6kvBz4DhGEbUJ5bi8Joq8kIpeT9GaWHiDM0ZF48NQEzh7AhaugKji3W/ZRNbESsaG 8/kZq2yPcSAPYaH2y7X0+WsJZkbW8xrbDfme14vvShhDLHsSUmh2ZWhMWCgtwA8E+RCb /qXCQxw/fRXUhlnBxiJ+ylTjn7ILCIXK0kekF9tf86nIL/qS+MSzTifVzCzJDAE5B0Yh 8zrGdOc7wdlTvxAykD6qXZ9Moy1bBQyqU0JAMbTwPPTdjch1qfyaLqMwC+jNABUx2TrF Z88A== X-Gm-Message-State: AOJu0Yw7BShFf3FJbUx7ZfJ3YEZFDEn0n3H8ZKFkDFpgq8vaAtMI7hAU 3GFeBIO/ukNkG14PWUoIGQ8lZF6ulv9TXS1x4TDo7SGolK8Keec7Y9LiEhdn92vM2tQbtx3otLk N X-Received: by 2002:a05:6a20:c70b:b0:1cf:5d45:3b29 with SMTP id adf61e73a8af0-1cf5e1577cemr7790850637.35.1726073450774; Wed, 11 Sep 2024 09:50:50 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71908fe4e7esm3186947b3a.80.2024.09.11.09.50.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 09:50:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: zhiwei_liu@linux.alibaba.com, tangtiancheng.ttc@alibaba-inc.com, philmd@linaro.org Subject: [PATCH v2 02/18] tcg/i386: Split out tcg_out_vex_modrm_type Date: Wed, 11 Sep 2024 09:50:31 -0700 Message-ID: <20240911165047.1035764-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240911165047.1035764-1-richard.henderson@linaro.org> References: <20240911165047.1035764-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.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. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- 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<