Message ID | 20250102180654.1420056-31-richard.henderson@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp7901569wrq; Thu, 2 Jan 2025 10:08:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW0lLAwiF4xcs2mNhcY/1HFJ8t51AGLEKjiNNqelFfbO/4KhKtWIXjbxXlls6eO2tJ1+I9C5g==@linaro.org X-Google-Smtp-Source: AGHT+IF5KhYQ67w+SGGTJkk+V9Jss8UKcbdP43ExEbaf1Zssg8TDNXFR5DYm1RmtJcNka1IyutNk X-Received: by 2002:ad4:5d4e:0:b0:6dd:d24:305c with SMTP id 6a1803df08f44-6dd2339dca4mr599170116d6.37.1735841324571; Thu, 02 Jan 2025 10:08:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735841324; cv=none; d=google.com; s=arc-20240605; b=MyKW+B89J4cb+nXOGPF6+Y5JDVpj6bBTL7aBEUizC3nrn8Wf3stQDb+ud+AdtwA5H1 mlLq9+6Zb1pe917W7wvWsFHLyR8x4rmDh/7EdUvt+u+UneEJEhlKRgXnytq32hbJa7x3 //98AwgaUw0SomWV+GfczgCJGizN46hXwMjs1nY3TbsPT1MqF51Pare1YoJLv3xdbvt9 wevqgGcDL7ncFMVbAhAOvTBW9aW0tCy32rFSHeE4mbcxFGdrHEw5KZn53xJ/lMco1T6a HzQB7gL0RW7p5JypHcwXtHNCDAvhRCy2qdR2H4AVP1G8YcSk2RoV8CevoQEnFAdXDcrT DCjQ== 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:to:from :dkim-signature; bh=sgVoWtpK77rxg1O2HQrgvJBz3K4KKWV6yZyPELMF82w=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=XOKAoHcNkx1OOeV/GCG/HuTC73wVUIkkrUeqyrgpCwp5px8u9dT31K7fj8aigkEtjg +OekBkrbokOgborC9GKlM91z+Ag5zkZMLukk1cIFPAtH2u5OBRU5ZVUJJjnCb1laRW72 cI1lTdDki+AeDL29nxw+N4f+SDgCZTQApdJRWzNoszk0EgUdd7RMHXVH2V4uw88MTRCd Bv7X6WD0BNyBuknE/C0r2+dCvEHO/7KrI7TOAdPTdrRE83kpH7YtYJowG4H928rWpBv1 RfLbmj+nG0MdCMyJqskScDo2OPLSyvSj4wB5/uoZVYI6fnQ/DLbKu0Z6abVe5kGCVtTd icMQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SWCBWjXp; 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: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dd18253997si334658176d6.375.2025.01.02.10.08.44 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Jan 2025 10:08:44 -0800 (PST) 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=SWCBWjXp; 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 <qemu-devel-bounces@nongnu.org>) id 1tTPbf-00079k-W9; Thu, 02 Jan 2025 13:07:40 -0500 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 <richard.henderson@linaro.org>) id 1tTPbN-00070h-KL for qemu-devel@nongnu.org; Thu, 02 Jan 2025 13:07:24 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1tTPbM-0005B2-4Y for qemu-devel@nongnu.org; Thu, 02 Jan 2025 13:07:21 -0500 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-2163dc5155fso155963215ad.0 for <qemu-devel@nongnu.org>; Thu, 02 Jan 2025 10:07:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735841239; x=1736446039; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=sgVoWtpK77rxg1O2HQrgvJBz3K4KKWV6yZyPELMF82w=; b=SWCBWjXpdBDRPmCCNtlFLb3qcwSVCaMe2Hhr6hBv96d8WK8ooRj9vDShU2Q5erRQU3 8XCt/UDozTOfvn9Drjy87iwESQczuPJcU4ASsvHu7y6teM2kJx8uLZpRTzxGEXsSQuBO kaBcjaPLe+FCl0BE9nEPD4WdK+eVhWW1fSJp0LILazmpkYWR6JJ/Gw4GgZuPB+sawKcA cvuL7XhsbsNruBanZL4J+nHxwqNb7gbFazPE3aeYi5DdYVUaaDSULTVkiS21GLKHgH1j MqSTPGEc5CLgKBqBup0O7jdim4/p9BAuD2suqQEIasD6ikJWqiWdE6P0c8gp9jiUNlVf o4Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735841239; x=1736446039; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sgVoWtpK77rxg1O2HQrgvJBz3K4KKWV6yZyPELMF82w=; b=h5JMARDgsoVQa9ifs5pXv/YfcaA42acTSUbQ21btWkF3QaMMEkaskb0TweshJvDPIx 7IJ5nko0GNqzGxZcQlP1aBYcA9N1N0+pxMvHmYZDqqqUU6ddox5MSwK1mPBVw1neO6Mt 8pKBFt9WOapF86mjkKh0dzjgERbecphBxtWOA9oYlyrAsafCHekm0PtyiVreZb8H2SKE fA9//xLgkwX52HjwpaQS5BJJKYBSulLmzaC+yzoxYmrwikx7p/Y5FEhD2bGe6hGaJ2EV /OQ3tLIxs6UEYRKlftmSaxMtPU2DvVRSteY63uYjtoDVR8WpGpi24BelYS349CLBH73X mSqg== X-Gm-Message-State: AOJu0YzcTXocbnefL9kES6vH8m1ME/ycIuntlqAQSqg6mLS9m3GkUqrG WK0hv+5RcJO7HHCGKSPU+v8bnsYHxueWJ1EHN1rDYJEGHyUfpZWJ+Z4MKR4uya7B+XwcjTr6nKr m X-Gm-Gg: ASbGncvzOh4MMc63lsLbuqCKCQRNVrRZ3DrwG7AtzcwYD9XA8PIxmsjTv37CIC0/5B7 JG0IjkaZLQcWW6+eY597xchOi605A9c7cG8SNe5405Cimrxh4lIK57haD6vr+fgUip+LS/6d/TJ gywc+uFGWIjoXmRVwx0VKk1dOG/pzc23kkA/hQN2c6WrjcBY8IVw8FPhPslop8qCNF2sIELtSSG 8aH+KZ07aIGNKmlbW5crrOsW1K5bfiTPD1U9ModBK+X0xHSwqzy82ud3cIPXQ== X-Received: by 2002:a05:6a20:cf83:b0:1e1:a094:f20e with SMTP id adf61e73a8af0-1e5e0470541mr65711929637.17.1735841238866; Thu, 02 Jan 2025 10:07:18 -0800 (PST) Received: from stoup.. ([63.239.63.212]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72ad3393d5fsm20604456b3a.154.2025.01.02.10.07.18 for <qemu-devel@nongnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 10:07:18 -0800 (PST) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Subject: [PATCH 30/73] tcg/i386: Handle all 8-bit extensions for i686 Date: Thu, 2 Jan 2025 10:06:10 -0800 Message-ID: <20250102180654.1420056-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250102180654.1420056-1-richard.henderson@linaro.org> References: <20250102180654.1420056-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
tcg: Merge *_i32 and *_i64 opcodes
|
expand
|
diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 167228a781..b7a8b3880c 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1329,16 +1329,31 @@ static inline void tcg_out_rolw_8(TCGContext *s, int reg) static void tcg_out_ext8u(TCGContext *s, TCGReg dest, TCGReg src) { - /* movzbl */ - tcg_debug_assert(src < 4 || TCG_TARGET_REG_BITS == 64); + if (TCG_TARGET_REG_BITS == 32 && src >= 4) { + tcg_out_mov(s, TCG_TYPE_I32, dest, src); + if (dest >= 4) { + tcg_out_modrm(s, OPC_ARITH_EvIz, ARITH_AND, dest); + tcg_out32(s, 0xff); + return; + } + src = dest; + } tcg_out_modrm(s, OPC_MOVZBL + P_REXB_RM, dest, src); } static void tcg_out_ext8s(TCGContext *s, TCGType type, TCGReg dest, TCGReg src) { int rexw = type == TCG_TYPE_I32 ? 0 : P_REXW; - /* movsbl */ - tcg_debug_assert(src < 4 || TCG_TARGET_REG_BITS == 64); + + if (TCG_TARGET_REG_BITS == 32 && src >= 4) { + tcg_out_mov(s, TCG_TYPE_I32, dest, src); + if (dest >= 4) { + tcg_out_shifti(s, SHIFT_SHL, dest, 24); + tcg_out_shifti(s, SHIFT_SAR, dest, 24); + return; + } + src = dest; + } tcg_out_modrm(s, OPC_MOVSBL + P_REXB_RM + rexw, dest, src); }
When we generalize {s}extract_i32, we'll lose the specific register constraints on ext8u and ext8s. It's just as easy to emit a couple of insns instead. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- tcg/i386/tcg-target.c.inc | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-)