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); From patchwork Tue Aug 22 11:01:25 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: 715744 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp193885wrp; Tue, 22 Aug 2023 04:05:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtyeGPPFezrDlzuNBiOL1t0Mtpe5wwJX3D31Ks9Ntt30DSCwc7GWiBJm4Wk/Xod4Po3mKa X-Received: by 2002:a0c:dd0a:0:b0:643:6a7c:9fbb with SMTP id u10-20020a0cdd0a000000b006436a7c9fbbmr12469681qvk.8.1692702349842; Tue, 22 Aug 2023 04:05:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692702349; cv=none; d=google.com; s=arc-20160816; b=mQWwFReqANeJr/kmpOoZpxeXyYfc4tljThIiXSjMi7Ip+JZPjTE7/LE90L1WU0F22H PGIkw5shdm9ptQBb+uUdGOY9rFPmGyW0ABBPfIoqBq06HOwI89Ozj8L/fpc2oX+BdfxT zfekRsw42m2v+lbFOFbOjgSv2GSLy2W9iDB2RxA1CY0h+xb81TADyEcPe0UUZQdt7SUm ODK3DmU6RpoEJjc6TkpZCejn7qGbG2N/66OYjCGpbuStzWVE+hiSzrVbVTl6pGfjqpak eaydRWq/Zd/OwVu980gah6R23Fkh1fAf9GhW7EN8otxQObsgB3uCYsVj2iATkrUlybtJ +Czw== 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=iElFObsC3ifF74P0i52/vlr1BqZqHUcD9/Vx9wOeGDY=; fh=nNMMnsLJfx+wwcL6Hpjyue2kO7c5wJkFUZ+p5f7qT8I=; b=ucDp4FIA1Q+PacY+mBxyjYpWreViTOmdONBM7r/F41OH8pGLwjoZ5gjVpyP+AVo24F yvCF6TDgZBM7GMz803egpcSPvdm03NvuV8O73XmAY9/ZwHp+QLTP+PDQ7R6TfzR1YjJm dXRFWQD2KlsLmJ/sDRh8a+v1xiRS2wDhz8qeAkzmRZZPfM6Gb86M0C7ESH7CuvOVuPfD 7uAGZnQ/ekxpLGdAiVHDDdVLGIdOZVaBIgAitsrLzb49gt0Jnbk92WxQPK8dOVrdoVjz pCB9KAPPgaEVCywCBOEFIr9PLuU0igRJSe5hQBlcA7F6dtijq8aRjnW/BTAlZszZx5ag CyPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w5VOsL8H; 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 m5-20020a0cf185000000b0064f4b7637e2si1063587qvl.269.2023.08.22.04.05.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 04:05: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=w5VOsL8H; 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 1qYP9i-0006SW-Lq; Tue, 22 Aug 2023 07:02:38 -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 1qYP9I-0006ID-Fu for qemu-devel@nongnu.org; Tue, 22 Aug 2023 07:02:13 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYP9F-0003Kf-0Y for qemu-devel@nongnu.org; Tue, 22 Aug 2023 07:02:12 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3fee87dd251so25426715e9.2 for ; Tue, 22 Aug 2023 04:01:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692702108; x=1693306908; 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=iElFObsC3ifF74P0i52/vlr1BqZqHUcD9/Vx9wOeGDY=; b=w5VOsL8HA902IBDleuj4nPXjr8wGO+zzCVi5et9JLr2e2P+DvkB7cT5JnSY4paZa23 lHVbn5nsDd3W/OeHcXBbV3zcIFMGqF4HjEgIWdrUT0fTFMrd9u8y8trNKDts4XChSXPZ 15fa6oGy0I6qFx6BwbtHW1PKyZJrLS3yvLUObrqt4IiGjIPIg5sNnQ5jnWug/+XOOvCp ltPf8jAfWkrwsHYTCEY51Wl72hAM2Wl+CXMpf6FvpMdx3BX9JtvX2PLlte1fY664eD5q Mhs3y/71+HX7vrAurDpEgfG4Ns6Cfq5iLo2vGs7QSGVfD5YBsXV7Hj5moQasl9JqvA0T FIOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692702108; x=1693306908; 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=iElFObsC3ifF74P0i52/vlr1BqZqHUcD9/Vx9wOeGDY=; b=KHbcefltPhF+m5y5zjiKYWeo3WK3GFTSQu5lG7a3jQ3mvD6jxfXIEBAOXSe/driyu2 ZWEOwaw+k7UVh3Pda2G7FFIwWYSIh7seShE1klRMLRfncsPxycCyNMLOrCxCytNCzJVs ae9hFp0ofGiraytk4gJ2Hf5xT4Q21hT2M0WttrWdithV5LZhpPjgFITLwBxqr++iRGI+ 7lgmcUOEOQkOaBVOrorEqfAAeahx0sFYqHh0rshEZQ+WOyjBkDssRVMfu856bsjjK2Ut va6EvMyKtBKMiKpVqEPqXtoY36JvBVNVYExwFg0zd2W+9TYhdpJ5y4RCaKUibTKAqUkv S23g== X-Gm-Message-State: AOJu0YwXnXmpn9zIDAJPQFlAIWLvBS26GYYoQcEoAIKNQV1Ag9r9DmpW D+IrB0RNrcgF80SKpVfWYn4MnRHubjtwhpASDZyzCw== X-Received: by 2002:adf:f44e:0:b0:31a:ea7d:49d9 with SMTP id f14-20020adff44e000000b0031aea7d49d9mr7728917wrp.53.1692702108101; Tue, 22 Aug 2023 04:01:48 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id e10-20020a5d594a000000b003140f47224csm15488415wri.15.2023.08.22.04.01.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 04:01:47 -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 2/6] target/cris: Use hswap_i32() in SWAPW opcode Date: Tue, 22 Aug 2023 13:01:25 +0200 Message-ID: <20230822110129.41022-3-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::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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 t_gen_swapw(). Signed-off-by: Philippe Mathieu-Daudé --- target/cris/translate.c | 14 +------------- target/cris/translate_v10.c.inc | 2 +- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index 42103b5558..925ed2c6f6 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -399,18 +399,6 @@ static inline void t_gen_swapb(TCGv d, TCGv s) tcg_gen_or_tl(d, d, t); } -/* Swap the halfwords of the s operand. */ -static inline void t_gen_swapw(TCGv d, TCGv s) -{ - TCGv t; - /* d and s refer the same object. */ - t = tcg_temp_new(); - tcg_gen_mov_tl(t, s); - tcg_gen_shli_tl(d, t, 16); - tcg_gen_shri_tl(t, t, 16); - tcg_gen_or_tl(d, d, t); -} - /* * Reverse the bits within each byte. * @@ -1675,7 +1663,7 @@ static int dec_swap_r(CPUCRISState *env, DisasContext *dc) tcg_gen_not_tl(t0, t0); } if (dc->op2 & 4) { - t_gen_swapw(t0, t0); + tcg_gen_hswap_i32(t0, t0); } if (dc->op2 & 2) { t_gen_swapb(t0, t0); diff --git a/target/cris/translate_v10.c.inc b/target/cris/translate_v10.c.inc index b7b0517982..0ff15769ec 100644 --- a/target/cris/translate_v10.c.inc +++ b/target/cris/translate_v10.c.inc @@ -506,7 +506,7 @@ static void dec10_reg_swap(DisasContext *dc) if (dc->dst & 8) tcg_gen_not_tl(t0, t0); if (dc->dst & 4) - t_gen_swapw(t0, t0); + tcg_gen_hswap_i32(t0, t0); if (dc->dst & 2) t_gen_swapb(t0, t0); if (dc->dst & 1) From patchwork Tue Aug 22 11:01:26 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: 715740 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp192790wrp; Tue, 22 Aug 2023 04:03:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEy/hcNluVqpIGuLpv1jiIgoRQops6QHTtmgqfhNrXb9lbvbE0H9ge9srbWcv05xuEhLyXL X-Received: by 2002:a0c:9cc6:0:b0:647:3387:fe48 with SMTP id j6-20020a0c9cc6000000b006473387fe48mr8277171qvf.48.1692702208030; Tue, 22 Aug 2023 04:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692702208; cv=none; d=google.com; s=arc-20160816; b=N8q/e6mh5RkWxDXf+c91qyXqWoqnAjkJW1kitNCXR84fwCFi53rBj1RmNobbRutLxP cL/MmyJ0QkThhXSqdGCFaE6F5ovdX+22Z4cFoq4xy0M9GPeJZhHx2Xhv2OMwboh6z4Bv o8GuAWGWbjbIWyVgn6lX8ejOD5bXF4SWMy/+BpVRmdLYSs3j0+t8O22LEo7hj3nP7qRY hwTNo8px02/DPvu2tCcdGLA9StupigCd6HT8s908mfo8yLOUOQvK/r03jsipwebgwPtF QaloBV6MKFO63f5pEyiBWGBK5QOf7QY2NZCA9CAwfZBcthhT7Zs4FAz9gzhNYhQwwgRP 5zNw== 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=Atmx7i5fRW8XnKx5xE4DtcYf6nuKJy8oiwMSi9RhaeI=; fh=nNMMnsLJfx+wwcL6Hpjyue2kO7c5wJkFUZ+p5f7qT8I=; b=PR7zEa7vmeDo8HOgWPkVf0yWbe9Ea2AiZe4rIvuhOicdLLBAZIM3kq90szvat1IDZr FiXv1j4xnhovyv9AqmG+d3neamdX7HJocXQh4BEiGGdAyRdM0LkLuwZZVidDNvud2EUL xAnSfxFe1losjKLK+tx1obGNWzCWzGJV/kwT/EN9QTixC2TYo1kts3/3BywEMZ6rvx7J 3m19DaaXtv7Kqi0BdGjtJUuYMHSXJOVG11RhpHapzIGdlJosVRp8iWahHKjYZbToMQAk MAGtirDb2BjKNvcmnQ8WS3w9ZRUJc4E6ITxaJPKE9avHAx+xFhHwx/g0rg2L7DB57O2w vYAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DYorDiCC; 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 t12-20020a0ce2cc000000b0064f36264cd3si3736001qvl.270.2023.08.22.04.03.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 04:03:28 -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=DYorDiCC; 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 1qYP9j-0006Se-9m; Tue, 22 Aug 2023 07:02:39 -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 1qYP9H-0006Hl-8f for qemu-devel@nongnu.org; Tue, 22 Aug 2023 07:02:12 -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 1qYP99-0003L4-E4 for qemu-devel@nongnu.org; Tue, 22 Aug 2023 07:02:10 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3fef56f7223so11877955e9.3 for ; Tue, 22 Aug 2023 04:01:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692702115; x=1693306915; 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=Atmx7i5fRW8XnKx5xE4DtcYf6nuKJy8oiwMSi9RhaeI=; b=DYorDiCC6zDmH3rqFYk/9pwrsrWWNUjRA/ght3xwkjFklcnQdpYFWvL+qkFjyrpzOR bK1c5yfkEibRK7NpzfOAI7nh64VO0CYbMTXp6fTu7y+Flpp3/QU3p+LHxGYrKwedSzl7 zJiSiIHsiTVcETt2Yp96OddYsq4Qk/K9Zy2r/loZVCvWOV2ARk87BXNCru4ne7gqBENU CZmxnReZEM+cNSaQjFpYDUvWxFjqs4vvIOzQlUPGeRC5hvaqiijEnphH1Kr9cU16yaYh s5iBTFDwesNDNGKLT+EmYmZ0ymSc8Mic+yi84AlnpV6X5WXPnNiHvKuuO0OcJLGzJnir c3rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692702115; x=1693306915; 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=Atmx7i5fRW8XnKx5xE4DtcYf6nuKJy8oiwMSi9RhaeI=; b=KzavGQYGo+sGAwDXXwpqDu7dNg/reMyPVCXxOjz0YUxmI9UlephBVsvF5qh28yxp3s N9mjCVCpA/XSO8nLA0kP14T1pwPKJkJcBhDorxPzWew6QjUHWA1D6m+WFg8i0G2kvow2 5llknSlFBasWD2Pkn3R7aIESmju0IcexYIsqskiOsIIZBtDoFgp8YtFk8hVpOQTKKfKk wSMsuIexI9ag0X10O1qqp/ZF8FM6bbOq9jRfeQwGVZP1b+Otttrm57TpsqtyhcR0IqSp kD0iRffhx12F7Va3obqZJRU0M042Eopy0Fl9J318IhxUgLDS5od4kkpBYz3GwPphmprK AHsQ== X-Gm-Message-State: AOJu0Yx2qJ21wTCwBsOOtUKX79ZAJM8uaVvB5aZa2mpw8n0cUoFy02MF HT7h7/cWZdw62ENIOfsbcoUtdXdBeWsIx1EZTGU6GQ== X-Received: by 2002:a1c:7303:0:b0:3fb:f0ef:4669 with SMTP id d3-20020a1c7303000000b003fbf0ef4669mr7074980wmb.17.1692702115000; Tue, 22 Aug 2023 04:01:55 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id v6-20020a7bcb46000000b003fbb25da65bsm15668820wmj.30.2023.08.22.04.01.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 04:01:54 -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 3/6] target/microblaze: Use hswap_i32() in SWAPH opcode Date: Tue, 22 Aug 2023 13:01:26 +0200 Message-ID: <20230822110129.41022-4-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=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 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_swaph(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/microblaze/translate.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 7e7f837c63..83fd1161f0 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -608,13 +608,8 @@ DO_TYPEA0(sra, false, gen_sra) DO_TYPEA0(src, false, gen_src) DO_TYPEA0(srl, false, gen_srl) -static void gen_swaph(TCGv_i32 out, TCGv_i32 ina) -{ - tcg_gen_rotri_i32(out, ina, 16); -} - DO_TYPEA0(swapb, false, tcg_gen_bswap32_i32) -DO_TYPEA0(swaph, false, gen_swaph) +DO_TYPEA0(swaph, false, tcg_gen_hswap_i32) static bool trans_wdic(DisasContext *dc, arg_wdic *a) { From patchwork Tue Aug 22 11:01:27 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: 715743 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp193732wrp; Tue, 22 Aug 2023 04:05:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFAFS3DjPTQTCYJYg9xoifOJNOdmIWu9patE1XJgc9W4++z6uTPt1mqH/OtJ2eJEd4VvzPX X-Received: by 2002:a05:620a:2443:b0:765:ada8:e938 with SMTP id h3-20020a05620a244300b00765ada8e938mr11641395qkn.22.1692702330288; Tue, 22 Aug 2023 04:05:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692702330; cv=none; d=google.com; s=arc-20160816; b=Sg5KGfMNMgdGm2kdqwnIvVhgg4YQv+ybTsUJD0H/bm7vCXD6nFKrabHaWr2wCGrcEE /DXeOLphQ95zgPf2eoBnESifvFfvhE3cXwOlzWYiL38lxHwD2Wabqso4L/6Stw/t1BrT 22jUAByN/+rkKAI6fGYL3Ks0ABrn268HX4lp/8ufucVFd3w0Mun7ff6T7zNQz85MEv/V I5RX4z5Yq7CtEB5R+g7Bl4/XnGyKVmngucXdfGAMR75NG/IQDE9I4Coo79CQ5BEdcGip teTEfnARY166GhsO3+IOycGtAubQvsm1bcsB7oO0Cx9gy/wukgn62o/TLDEa0HaFbcOO L2+A== 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=emowz0axu/kGB6eTmVL35kBP/OFbuZg2HRDsrnbXrTA=; fh=nNMMnsLJfx+wwcL6Hpjyue2kO7c5wJkFUZ+p5f7qT8I=; b=Ajo3zdNVxSi8v6/zBG8TNUZW68mlGQJT0rk9S1FozY8c+7oPy+XXeWyGr/OFX0xgAh GoA49SMqoNNhjgCBIsqjVrCshAeMC5kLEozJa+4ZMe/YlaElaUh94AfiLCqYMpgZY6iB hs/JMu8vogWqTRAAjkKNhCcOw6FIW7Sd3QXIQuDfAvfaIYYe7nI0Z7Tn6kLKLN481bhz wdJA3TK3Rj2cvx4wpacqwMALrIgLss8HjJMHi+Gw+kJpW4Jh21arLbM8TXePU7R1cA1l 27GW6/0QM9jTfN+e1+k9IBHBqlZb8SNcvse1e6xh1dL2VceRjieJO/zK4uq/DQCcf9Qo cEIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HJp2t9c4; 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 r7-20020a05620a298700b00762dfc825e1si6006009qkp.342.2023.08.22.04.05.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 04:05:30 -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=HJp2t9c4; 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 1qYP9i-0006Rk-1u; Tue, 22 Aug 2023 07:02:38 -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 1qYP9I-0006IC-F9 for qemu-devel@nongnu.org; Tue, 22 Aug 2023 07:02:13 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYP9F-0003Lm-0U for qemu-devel@nongnu.org; Tue, 22 Aug 2023 07:02:12 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3fee7b7689dso26073975e9.0 for ; Tue, 22 Aug 2023 04:02:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692702122; x=1693306922; 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=emowz0axu/kGB6eTmVL35kBP/OFbuZg2HRDsrnbXrTA=; b=HJp2t9c41grX9JI1wNgMU9cHLkvXsxLAxm54fboaHuOiSqdzi2jm2DWq/MTHvWe/Q0 Ft0BQIkNxlqpSyxNB1GUIeXD3vU8F+OCGTucV93L0CUFPP6PGjvE59H1ISjgpw7GI3NM 2ZXvCUW/O200mQBVJfOyi4sLgj/JE2/HcQ7q0uysG9kMkI1GOijtFGZ4PgBJ4N86XLmk iJf1Rrnhkd5hvHcf6jjcLCLOrgq5hVV3a267Vj4ZDuEqjVip+fCBoSuH+OibkCcmSTJi nyuKqDsV1twNMhJXZDeGObB4O+g8gLcmnG1HUTsmSuIoc+SfPlgdMYQftsTKAW978mCH PiSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692702122; x=1693306922; 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=emowz0axu/kGB6eTmVL35kBP/OFbuZg2HRDsrnbXrTA=; b=aD/SpqE6IeT/wRmZ976jgeUlphR2P0g8Lcap54AhSAo110Fhzbb3uijwqR421tD+cM V/mdduhFWg8agYO8Bm/RkGtyLDgf6XkLhTpEn6YwPFP7YNulKmyOPV6Cee29eYOya0HM 1DTGUkC9ggoGhyPC6I3Lp4yREGiwnUDA7lN+YgEn4p0F2IYBuTRo87MFIMlmwVsPDtB9 qTqPKcZnhspbTy81CG9tbMXo936nOJMyMKEgPoOHYIXDfO55cQK2z2EVoOX6D6b4KEYe dqYueyosNzCKXRaCSYaFo5iYlidY0kZJcUIoLmYuQyTngFEcgy0hA0KTP+45m9RJ8fHp 9f5A== X-Gm-Message-State: AOJu0YwEjck6rf9pKvjx4UL/pyLQkFUHtCIOO0LNaCOUfESmQW/7DZVA jWmJbGjVpDCK4AAFe7MGhbOyfMO7WRHjXrguCg0eyw== X-Received: by 2002:a5d:58d9:0:b0:31a:d344:38eb with SMTP id o25-20020a5d58d9000000b0031ad34438ebmr6621664wrf.45.1692702122703; Tue, 22 Aug 2023 04:02:02 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id n16-20020adfe790000000b0030ae53550f5sm15380844wrm.51.2023.08.22.04.01.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 04:02:01 -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 4/6] target/sh4: Use hswap_i32() in SWAP.W opcode Date: Tue, 22 Aug 2023 13:01:27 +0200 Message-ID: <20230822110129.41022-5-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::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/sh4/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/sh4/translate.c b/target/sh4/translate.c index 49c87d7a01..0f96a099b3 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -678,7 +678,7 @@ static void _decode_opc(DisasContext * ctx) } return; case 0x6009: /* swap.w Rm,Rn */ - tcg_gen_rotli_i32(REG(B11_8), REG(B7_4), 16); + tcg_gen_hswap_i32(REG(B11_8), REG(B7_4)); return; case 0x200d: /* xtrct Rm,Rn */ { From patchwork Tue Aug 22 11:01:28 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: 715741 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp193060wrp; Tue, 22 Aug 2023 04:03:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4nvao5LPXMb/Uz//wYFBA8Jr9oiEmr0ySNxBfDb6OWyoccW42EsRidm9Gc1kGpcNfj/vD X-Received: by 2002:a05:620a:389e:b0:765:8986:a3bd with SMTP id qp30-20020a05620a389e00b007658986a3bdmr9145403qkn.69.1692702239370; Tue, 22 Aug 2023 04:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692702239; cv=none; d=google.com; s=arc-20160816; b=tl1RsdtgpdpxNexqTIJYvbZjSVa1HS/KC4nwAIPERAS2E7uMgt2be4XvVxSTOaGyy8 HBQYdtt77oPzxtLZI8uPNF+bGxFEqkULzhAuKERy8Kh0ofrWzaYUcgiZZUtViS8VL1pM ZTMQvCSOk/KnVK/6R4HkaWGPviyiVV9r4Hj+rbTiF0Q2/tOl5A2xKQZen/Iz4xTWfcTR YmNVsqHscNkAPRKAFERTVTpIeKt6f7JPW5VHorSlp2ggq3pE000jcQmnUWD0aF6Iuqgs 2M4yIUzoRLyPQbdyC5s0SemK7NexD6RQ+fCpAbIriU9DM+d5YraYzOZJFe10TKlF7ol9 1yGQ== 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=94KriI0niEOcMbu2tDSQW96357N95QTAdPKbo4MTmaA=; fh=nNMMnsLJfx+wwcL6Hpjyue2kO7c5wJkFUZ+p5f7qT8I=; b=EqX8gGKKOewnNLZXNSa54dstJSbxyh1PXnSomyB2AMv7lZ8oMfjtx0Mis0Rrj0ga2m ebViOPuqsy8vEHQ/2cEeEHH1DqJfF7VP9mDGRVxCe2xY4BRDjcgEFbxtdkAegVF3PCGU yOUgHFF0iWuWyZ75GjtG+ceIftqWV7MX1PDOaNhQS8QKyl3rPRNQud6DGyV3nsFuPj3/ CxQjoSQxNJffucdHptH/kziAdnoUQDSoBzFh9qyDPeCB4xB5kp7bgsOa+8wT3opOURAb dhxnjGftwxVeOcs3ZS39rVXKCOGjkYJQaH1Rw4+bc2TnRsny1pjT1u3H5/Dq1KyeWdiO ZFWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h5S5A+es; 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 az36-20020a05620a172400b0076da008f6ccsi3787514qkb.288.2023.08.22.04.03.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 04:03:59 -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=h5S5A+es; 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 1qYP9h-0006Qq-LG; Tue, 22 Aug 2023 07:02:37 -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 1qYP9K-0006JP-Nl for qemu-devel@nongnu.org; Tue, 22 Aug 2023 07:02:14 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYP9H-0003Mk-Rj for qemu-devel@nongnu.org; Tue, 22 Aug 2023 07:02:14 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3159d5e409dso3399304f8f.0 for ; Tue, 22 Aug 2023 04:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692702130; x=1693306930; 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=94KriI0niEOcMbu2tDSQW96357N95QTAdPKbo4MTmaA=; b=h5S5A+es7DmCFoaLeGCa4PV1hyy6CUGtK9Xg2SIyzmZ0nOuJevfPSqlAeH2GZxlGSX ZvSQxnBRlqDg1ss35urod3/mnBenDmUpCEivWCjecuN7Jn242BU7RSY5H7rg6NPJm0Gw XNHbprDZfJJoa3DfZ0PQ17XYek3G754uFrJh84vCKayE8hJMYRsfzV/0NGwNGdGhu4/z P8+aKHSwoWw9AxWc5elzjIznaBtNFYYKqUdE8ZkABBTZUpJsMdyPoXivqY09ShDnJcBs 79/KJYQ9dIQR7sIeEQ1KzK2bj4TI6Yr63dS0i3ONUNhoYCuYkS20OtFSbNe6rMTsgd+M t0VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692702130; x=1693306930; 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=94KriI0niEOcMbu2tDSQW96357N95QTAdPKbo4MTmaA=; b=aGaze1R+HlNe4dHakMWZIXZSsNKK9Dl2pGySkQpoIkyQnD20XPwnIgfoH8m6qYELTO TYGn3L51FV2URD2LaUYcj5oRt+RBmKCJff329LsCpDrlRYhjmFXbkNSQALyqSwkyIuKv zGBn/jWD21buZ2waMllHOHXxCvgQJIXpyk+9orpRIa9fW/H3uU9Z0JOORL6xgPPRs0m2 WkRpEll/bdqKifMNE3tzapVwOFsqW66geiaEZ5YgLAOO0yycTcHiRQ5T1EvD76utH2E1 bh+SgZOFjWnGb/l0NK258KGNy5a+nb9qIPARSxhXuW7p2vfrq/iJ8hYExp3Uqcu13hsX lNyQ== X-Gm-Message-State: AOJu0Yy02GcCEHVSpRJgNVXZPfjoqhHE9Eu/FBAOd8YUvO3PkP+3991u xyd4BDLf84ghfXujCktQ/S2UEyGsVL/2RcVRD8nPNg== X-Received: by 2002:a5d:470f:0:b0:317:dcdd:3fa1 with SMTP id y15-20020a5d470f000000b00317dcdd3fa1mr6545955wrq.34.1692702129860; Tue, 22 Aug 2023 04:02:09 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id f8-20020adfdb48000000b0031934b035d2sm15656693wrj.52.2023.08.22.04.02.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 04:02:09 -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 5/6] target/mips: Use hswap_i64() in DSHD opcode Date: Tue, 22 Aug 2023 13:01:28 +0200 Message-ID: <20230822110129.41022-6-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::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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 Commit 46be8425ff ("tcg: Implement tcg_gen_{h,w}swap_{i32,i64}") introduced the generic hswap_i32(). Use it instead of open-coding it in gen_bshfl(). Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tcg/translate.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 9bb40f1849..4f34ea9b6a 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -4948,19 +4948,7 @@ static void gen_bshfl(DisasContext *ctx, uint32_t op2, int rt, int rd) } break; case OPC_DSHD: - { - TCGv t1 = tcg_temp_new(); - TCGv t2 = tcg_constant_tl(0x0000FFFF0000FFFFULL); - - tcg_gen_shri_tl(t1, t0, 16); - tcg_gen_and_tl(t1, t1, t2); - tcg_gen_and_tl(t0, t0, t2); - tcg_gen_shli_tl(t0, t0, 16); - tcg_gen_or_tl(t0, t0, t1); - tcg_gen_shri_tl(t1, t0, 32); - tcg_gen_shli_tl(t0, t0, 32); - tcg_gen_or_tl(cpu_gpr[rd], t0, t1); - } + tcg_gen_hswap_i64(cpu_gpr[rd], t0); break; #endif default: From patchwork Tue Aug 22 11:01:29 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: 715742 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp193728wrp; Tue, 22 Aug 2023 04:05:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGPp+DmmNxiHNbjTEVscZt+LTiJdgrTQOsfVc+09bRyBbernjlYSus2e286JTF2Yw5MxNzL X-Received: by 2002:ac8:5956:0:b0:40f:ea3e:777e with SMTP id 22-20020ac85956000000b0040fea3e777emr12518165qtz.21.1692702329894; Tue, 22 Aug 2023 04:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692702329; cv=none; d=google.com; s=arc-20160816; b=KuuOUpQEYd1qzT+j5n1D4CZ/lR9I1oihz+Um/m4LUgCi7iXuOX4r3t4CXybxoiqvAm BAEZJSm+vQTD/gh2Z12OoWEWJZNV7tClnjOVTQvX2uD8Q33C0cOiQjYxZev+3fovzQCQ 2dltfc76v4DMHaHplSHfL/lACAJYrJ6PgyLRQz0lm3Aatk+PVyOl+ykFfDIihNMsiRmW rDGd1i6Oche7tAxq0JkQopQab+6624A6QK9lrH2j16E4kP5h2IPweCxNm2m9Y7Dkzjs3 L1ciZvCuMU4Xk5FSSQNrlkRG7YqxcZDhP2W5qhuNSdVoByCJZ/ch0xx6SIv3uKwE+hrm ++Ig== 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=LEM3PfJxI/aPPc1i3tV/XEA6n73WFfBj06/t4sKpaao=; fh=nNMMnsLJfx+wwcL6Hpjyue2kO7c5wJkFUZ+p5f7qT8I=; b=Ye4zPnDbGRpfZhddpYMTO4xlJXp/PxiqUxDABVd/g9zTKii+/Cw0/q2Yqf1ofGTe0S D6n1vnGezE7Z3MCHurZjFIVAbKTuQ0iwzHAfVjrPwj0TIRVutf6tAmehG1sI+Ncdd++o AxL1Sa29uuJyfo6Z/9eIikvCCObZtSCHTDoh1FWpOTb5/5M5bgB6pbzlxE8OW+jg6C5E PtWVAqB7qAFBKfVyNAoAjREEXJ2oH0JIeu7Wu6rEyxD2WFzEvOR6u3F/MG0CqnClH9iJ 7q88NKJMOmvH8tuxD9uh3aX01s8P7vse6m3UviTpci9oe9auzGbpo1E1G/aEKOLkAmvd ck9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nBsXcbcv; 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 ESMTP id m15-20020a05622a054f00b0040ff1f5a4dasi5961689qtx.412.2023.08.22.04.05.29 for ; Tue, 22 Aug 2023 04:05:29 -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=nBsXcbcv; 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 1qYP9i-0006S3-9N; Tue, 22 Aug 2023 07:02:38 -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 1qYP9T-0006N4-Ti for qemu-devel@nongnu.org; Tue, 22 Aug 2023 07:02:29 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYP9P-0003OY-0w for qemu-devel@nongnu.org; Tue, 22 Aug 2023 07:02:22 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3fef5809999so11877005e9.2 for ; Tue, 22 Aug 2023 04:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692702137; x=1693306937; 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=LEM3PfJxI/aPPc1i3tV/XEA6n73WFfBj06/t4sKpaao=; b=nBsXcbcvOtoGhumKewU1elFD1KRIs/anotvQ08PGmWuTeqEJwCThrSWGBHVsmkHgBe /uEE/7TDC969ZHn3s1Gc21FVS7h/JtJGeQAWzGNJBcM18g52OoZueTz2urGBMVZ5nz4w aU0a1Fj+OyQXHD3Brej6Z+eo6RsTYC1dVzu2IZjkCfbp9opMEN+9GuTfoVFlAbeLkpQq 73NWKWrADLFikStDJGdMmE4yO9AmIsnwAdPH24cl9+IG+/lLwrfK3RSPfo/NfGhp+anj E9FHVoXnimo8ZsXFG9o6NrLiKki+0NC7ZcPVl9PoKy5GSjJLQYiTwUDy1cpSIwWbeqM8 YBmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692702137; x=1693306937; 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=LEM3PfJxI/aPPc1i3tV/XEA6n73WFfBj06/t4sKpaao=; b=aPe2dgQigykqF9BGEbU2TlFDRqRWzNOC2rEUxkS9vPYbm71HxKpBpqi7pZlCqToBYm L/aXKD0uZszyNinEZIlpjF0t2FFU3POsnnvROsbMnq6P6EztZfiN8k4gDwTMYJ0naN3N r8CShSM6dAa62Zeo0wZ9Aa1R1752DityVLW61zZTKTcvJu7L9u8mriE0IhQGzyiDFhcV RC/gsynL+aHiLiexx6F9BRrv7PeklnlI9if5CZTA0Rhs07tkK5Iw1ZGPAdahgTGGYAMX +nNYbs8V/kF0cjP+jlvEpnT9JMqEZQoGRsFJIzLSEESyPU75TjCrZp5ZrFdp2PLmK1tn u3yA== X-Gm-Message-State: AOJu0Yw0GEkacBigUY8qKuFJ15o2ql639IYZrloxHyzACYre6kKWN7ft M9YWLGm2otoKLyyIHdSIZmV4tflhxxi00ojzM/2wcA== X-Received: by 2002:a1c:770b:0:b0:3fe:2109:b9ff with SMTP id t11-20020a1c770b000000b003fe2109b9ffmr6993689wmi.0.1692702137029; Tue, 22 Aug 2023 04:02:17 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id z26-20020a1c4c1a000000b003fed1ba0b8esm14604106wmf.8.2023.08.22.04.02.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 04:02:16 -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 6/6] target/loongarch: Use hswap_i64() in REVH.D opcode Date: Tue, 22 Aug 2023 13:01:29 +0200 Message-ID: <20230822110129.41022-7-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::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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_revh_d(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/loongarch/insn_trans/trans_bit.c.inc | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/target/loongarch/insn_trans/trans_bit.c.inc b/target/loongarch/insn_trans/trans_bit.c.inc index 25b4d7858b..95b4ee5bc8 100644 --- a/target/loongarch/insn_trans/trans_bit.c.inc +++ b/target/loongarch/insn_trans/trans_bit.c.inc @@ -150,20 +150,6 @@ static void gen_revh_2w(TCGv dest, TCGv src1) tcg_gen_or_i64(dest, t1, t0); } -static void gen_revh_d(TCGv dest, TCGv src1) -{ - TCGv t0 = tcg_temp_new(); - TCGv t1 = tcg_temp_new(); - TCGv mask = tcg_constant_tl(0x0000FFFF0000FFFFULL); - - tcg_gen_shri_tl(t1, src1, 16); - tcg_gen_and_tl(t1, t1, mask); - tcg_gen_and_tl(t0, src1, mask); - tcg_gen_shli_tl(t0, t0, 16); - tcg_gen_or_tl(t0, t0, t1); - tcg_gen_rotri_tl(dest, t0, 32); -} - static void gen_maskeqz(TCGv dest, TCGv src1, TCGv src2) { TCGv zero = tcg_constant_tl(0); @@ -193,7 +179,7 @@ TRANS(revb_4h, gen_rr, EXT_NONE, EXT_NONE, gen_revb_4h) TRANS(revb_2w, gen_rr, EXT_NONE, EXT_NONE, gen_revb_2w) TRANS(revb_d, gen_rr, EXT_NONE, EXT_NONE, tcg_gen_bswap64_i64) TRANS(revh_2w, gen_rr, EXT_NONE, EXT_NONE, gen_revh_2w) -TRANS(revh_d, gen_rr, EXT_NONE, EXT_NONE, gen_revh_d) +TRANS(revh_d, gen_rr, EXT_NONE, EXT_NONE, tcg_gen_hswap_i64) TRANS(bitrev_4b, gen_rr, EXT_ZERO, EXT_SIGN, gen_helper_bitswap) TRANS(bitrev_8b, gen_rr, EXT_NONE, EXT_NONE, gen_helper_bitswap) TRANS(bitrev_w, gen_rr, EXT_NONE, EXT_SIGN, gen_helper_bitrev_w)