From patchwork Tue Aug 22 11:01:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 715739 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp192707wrp; Tue, 22 Aug 2023 04:03:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFX5DxIOKgsDTB7CkyTb+cg0lNufdRkbgtGhZsVmhe9qAX/WEt/b7iroM5ifs5Bfef5zgZt X-Received: by 2002:a05:620a:414b:b0:768:14ee:234c with SMTP id k11-20020a05620a414b00b0076814ee234cmr12160652qko.50.1692702198694; Tue, 22 Aug 2023 04:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692702198; cv=none; d=google.com; s=arc-20160816; b=BvWrPxPQKJBrDG0eTmXOJpy9jWdRSVe8JL1Zzuthc6eqBYhDhyytOdfu3GBTZu561K b7uOsA4Kz4jAWB1rJ8P5wr39O/Naxkiq3jj0bnJuxQ2IcQZJcSEDNqMhUjRKVZ8opdpj 1pfb6G2jp/ISz6xozAfh5SEi3+sE7119uy6KDDcJoeZ2NgqlXzLh65kpLNHcGVvGpAXZ t6WXj77ggID8WM61307bWYCi7NUgvTVORyIPi+aq6bUygVJfE512AUMEyKnSQosdOiJo pL/0NB+vyXmlZFfTIlR0EF0pTaoYwAJv4OYS5KMxwMW+TP8wC1llh6u04f9oCbGASogF Ahkw== 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=INGQw2gZIfMCcsQ3FRMd0eCw/OR0PNFJSBfJGOnsR8g=; fh=nNMMnsLJfx+wwcL6Hpjyue2kO7c5wJkFUZ+p5f7qT8I=; b=M+MMW1nF2wCRwLuT2r03W0H/tRZQmdY1RcekkdnNVrRcFH7QxYEIKEfrHAa2uOluiG 8JWIG2LDwStvXTTqdBayvHqYdzPO3A58acSZ/myucmMhH6ncM4+plNAYX+5zMyZgxw09 axdn+da/4dmuSZKHgVW05sQPmv3goCU9zC7VRQtGIlOfp9Ql1M4IbL/+AUJA/VyGRasN o8uM5f/Adso+NfJ2ogI9m+4q48BRPn3Ds7FJ514q41UXWY49gOeUY4UN6gw2Nxnt/pSp S4KeSiunfDC9ClCr73e8vtleT0jEYgduXgDj64VK9P5zOKXxwrNs6GjbKTv+OTaUitl+ s0zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jNFIBzf1; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y11-20020a05620a44cb00b0076daf22619csi1505513qkp.225.2023.08.22.04.03.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 04:03: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=jNFIBzf1; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYP9Z-0006Mq-J6; Tue, 22 Aug 2023 07:02:29 -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 1qYP96-0006D0-EJ for qemu-devel@nongnu.org; Tue, 22 Aug 2023 07:02:07 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYP8s-0003Gs-6O for qemu-devel@nongnu.org; Tue, 22 Aug 2023 07:01:49 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3fee51329feso17747475e9.0 for ; Tue, 22 Aug 2023 04:01:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692702101; x=1693306901; 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=INGQw2gZIfMCcsQ3FRMd0eCw/OR0PNFJSBfJGOnsR8g=; b=jNFIBzf1c7wg+qjAxvGMDjsDm1G6q0SQSGIBC+vnsOIIITeV40Vu21S/TlouBPiMnT fv249pSK0msRdnsJ0zTzx+iZYAXz6HaBFTEWeidOJFE90mqBEkjJ80Z+ElQaB4+8P0IF kvzefs4P7cmFc3lUiNfHMg8oS5ea2kyQSVEKO4LqD6NUhyPjNJeqS1LCl/UBZSqGErwa gdB+o3cq4jVUHGG986E+qwy01dwuKc5igLaVhiFp3yOj/bDDyNqwTATzrrvWhLzDfxs4 CuQ1P0If+ig1r/SqUpZc3cpmU1gL6DE9FSB4GiVPYXXoTSc9pew8uMY6OhjX5aKqkV3D KcXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692702101; x=1693306901; 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=INGQw2gZIfMCcsQ3FRMd0eCw/OR0PNFJSBfJGOnsR8g=; b=PJDt0sddzgMDstZsGxksz+VXOGhpo6MHrDQxtmd8lDEtBT6Lo/xC3AkZ8g1ku+tuqa 4RbXbWItW5DeCJIKRRD+0SiPeiMEw5ppQXVDhKmWTwBYuK+W+1yk9gG424dEE/fwqP7g JO7q8XzB6MZuS/zK0nGGoz7tB+jv0KHplDjiuKieq1DSRN5MfrZGnx9saWKOfRQw66E0 4sfs6RSPKHXT/GDdGScAYQURxM5tnBBIkxM4iavkxC2/G/mjOhXghPHLm6/K0+XitW66 2C7bcQFErw/RqlDFU+3saID2cfj5TCqOJgHZkLjnPuHSJQ42eNnbom+5do25xLptdEnB jfSg== X-Gm-Message-State: AOJu0YwK2dX3sYxfjjLGNPQAD813ZY82XwyaeH8iSlmPk+i9N2bZCyns Nl6HC98PzvxzccTD6wCEUg8JuF70rbHMm+HdC7FUpg== X-Received: by 2002:a05:600c:1da1:b0:3fe:3389:122f with SMTP id p33-20020a05600c1da100b003fe3389122fmr6632341wms.1.1692702101072; Tue, 22 Aug 2023 04:01:41 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id t8-20020a7bc3c8000000b003fd2e898aa3sm653051wmj.0.2023.08.22.04.01.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 04:01:40 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Aurelien Jarno , Xiaojuan Yang , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Aleksandar Rikalo , Yoshinori Sato , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Peter Maydell , Jiaxun Yang , Song Gao Subject: [PATCH 1/6] target/arm: Use hswap_i32() in VREV/SMLAD opcodes Date: Tue, 22 Aug 2023 13:01:24 +0200 Message-ID: <20230822110129.41022-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822110129.41022-1-philmd@linaro.org> References: <20230822110129.41022-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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=unavailable 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 Commit 46be8425ff ("tcg: Implement tcg_gen_{h,w}swap_{i32,i64}") introduced the generic hswap_i32(). Use it instead of open-coding it as gen_swap_half(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/arm/tcg/translate-a32.h | 6 ------ target/arm/tcg/translate-neon.c | 4 ++-- target/arm/tcg/translate.c | 4 ++-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/target/arm/tcg/translate-a32.h b/target/arm/tcg/translate-a32.h index 48a15379d2..0c8f408eea 100644 --- a/target/arm/tcg/translate-a32.h +++ b/target/arm/tcg/translate-a32.h @@ -158,10 +158,4 @@ DO_GEN_ST(32, MO_UL) /* Set NZCV flags from the high 4 bits of var. */ #define gen_set_nzcv(var) gen_set_cpsr(var, CPSR_NZCV) -/* Swap low and high halfwords. */ -static inline void gen_swap_half(TCGv_i32 dest, TCGv_i32 var) -{ - tcg_gen_rotri_i32(dest, var, 16); -} - #endif diff --git a/target/arm/tcg/translate-neon.c b/target/arm/tcg/translate-neon.c index 8de4ceb203..0e59b03ff9 100644 --- a/target/arm/tcg/translate-neon.c +++ b/target/arm/tcg/translate-neon.c @@ -2906,7 +2906,7 @@ static bool trans_VREV64(DisasContext *s, arg_VREV64 *a) tcg_gen_bswap32_i32(tmp[half], tmp[half]); break; case 1: - gen_swap_half(tmp[half], tmp[half]); + tcg_gen_hswap_i32(tmp[half], tmp[half]); break; case 2: break; @@ -3516,7 +3516,7 @@ static bool trans_VREV32(DisasContext *s, arg_2misc *a) { static NeonGenOneOpFn * const fn[] = { tcg_gen_bswap32_i32, - gen_swap_half, + tcg_gen_hswap_i32, NULL, NULL, }; diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c index 1a6938d1b3..39a42611c6 100644 --- a/target/arm/tcg/translate.c +++ b/target/arm/tcg/translate.c @@ -7612,7 +7612,7 @@ static bool op_smlad(DisasContext *s, arg_rrrr *a, bool m_swap, bool sub) t1 = load_reg(s, a->rn); t2 = load_reg(s, a->rm); if (m_swap) { - gen_swap_half(t2, t2); + tcg_gen_hswap_i32(t2, t2); } gen_smul_dual(t1, t2); @@ -7700,7 +7700,7 @@ static bool op_smlald(DisasContext *s, arg_rrrr *a, bool m_swap, bool sub) t1 = load_reg(s, a->rn); t2 = load_reg(s, a->rm); if (m_swap) { - gen_swap_half(t2, t2); + tcg_gen_hswap_i32(t2, t2); } gen_smul_dual(t1, t2);