From patchwork Tue Aug 22 12:53:31 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: 715755 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp240394wrp; Tue, 22 Aug 2023 05:54:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZ74j0jNWJbDY3IRDwK8xUMI09luWqkZNOaKGZlSx1xwRAgw6uBxAnydsOqkihgualTPoo X-Received: by 2002:a05:620a:1a8e:b0:76d:ad36:555c with SMTP id bl14-20020a05620a1a8e00b0076dad36555cmr4255692qkb.43.1692708852695; Tue, 22 Aug 2023 05:54:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692708852; cv=none; d=google.com; s=arc-20160816; b=d2bgrGf9p3u/hOQTNL8cwYnmM4t8yguXw6x38fodu+wMmQ8BvlU/4fT3bvugl48v3D KrNtyHc/YfF2UB9upA3tV9N9koEImenvJhna0LUnRukLo8Pusyb5au6Lx0YOm/JTHLy5 w7qP5RhYt5PJNAQiCTPYJQDeg5c4hxU6vugk8bKaIAbHfBy2wxhLLoH110jtH2jw+gj9 /hzAHc/SteSx+yhLWSTJHNuAwfNsE7TRLqR5d3GVOIBvF2yEdjfLLXbnVaTP4uFXcVP3 xDPGJS3MQ+J3igA1Agn6A0DmBztBNG1JjEqcw9VY0WTBZ82i5Y0YlIFVmbG0GDepPG3y hsNA== 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=Icl2oC8GOqjO24t8EWhlRVld/KcOgjsSN5YvmxZ62js=; fh=WTNzBzBWhI6YyLjiFd1Gx/+Ggetq/7tfVgf3EfLcLKA=; b=k24znK2Oy4iYq0OQ3xWKVJf1fzVO1lB+tkoAeEmEb90Zj8n1xnxjWfer0EpyKHiIgg aj/UU1xwY7P/IY1ltb3jEUZtr3jEawZJylPXl32I5qR9jeit1QOky4zVvbGeXuTNFrPE kbm6u5VsakiH7lSf7zD6imyZEuanG0tGFJQAOdyXjm2zaMirfrUjnQVJvxAXnKY3L3xq qlJkmlmAsjBHp0XmKPuG3Y45+H3KrDwEN4/0jEWexhHis6aGS6hRbVuK/UND1kLeEjvE bISBPohMpvJMchkc2zrR/MjliD2pvFb1od54BpWJob6iDP1DVJCcmOmBIBKs9K3CEKbt xb9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gp9lX3VD; 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 rj3-20020a05620a8fc300b007673d260cabsi1154378qkn.731.2023.08.22.05.54.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Aug 2023 05:54:12 -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=Gp9lX3VD; 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 1qYQtF-0002aM-Jc; Tue, 22 Aug 2023 08:53:45 -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 1qYQtE-0002Zb-0k for qemu-devel@nongnu.org; Tue, 22 Aug 2023 08:53:44 -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 1qYQtA-0001x7-AA for qemu-devel@nongnu.org; Tue, 22 Aug 2023 08:53:43 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3fe4cdb72b9so42477025e9.0 for ; Tue, 22 Aug 2023 05:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692708818; x=1693313618; 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=Icl2oC8GOqjO24t8EWhlRVld/KcOgjsSN5YvmxZ62js=; b=Gp9lX3VDoXX35GM5xyhu2PCd9ow6FOVUajl8oZz8OU/Dsya/BMC4kUvSTeAE/VS5II ftoxjDg2l5GvP0Va7K9DJefDdfD3F0TVxt+BN9Jx+qf4lUi0KrZQIzognPu81wg9docv uBwmQb2BWFweD+vKAWBxftuv1CJaWRE/cMxeb/Xk2r7els4pEa+xOdcifHReIgDqQEhk rrvx89ojQyr0UxWmm5XSUQIIZLPI0huQMYJw6AREQDC6oF0U6jn3MnK2pH4myMbn2RFm /IkqfVm3etK8Y/p2xgBsGU7jKJGbditWvzQvjWlALqayN+dooyUGYG7dEOVdsSztUPr7 KKvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692708818; x=1693313618; 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=Icl2oC8GOqjO24t8EWhlRVld/KcOgjsSN5YvmxZ62js=; b=Ls0H7yfY89vdlhxvgy4VPgKShPBZLqRMXRyoK76JCdEvxV4+RrRiAyLhEY7jW2KbQA EA+SUXeDqbLBfQX2OsxKlVKvR3o1QhEjG9EPAeeTX5xIPWc5VpNYs2XhtoVfNTkZR8lc d9ZwG2etOHVywfhE/WZKOFE8GXEMkOAyrl3Op+m7t7aF+JoHBBO8kC0Kp+77hrx1IU68 PIujTGHQS6vf2aIVOV0vnEoXhi7sPKvDTV6qzEX5mPtWlKzSQY1H8GMjqXd4aJTOC5Ux u/hBmDn2Lx/pIuexrU0GLfH+PCNu61IcS/2Uq1suA4tqo4jew2hBYTm23fj0cagm2jxp oeAQ== X-Gm-Message-State: AOJu0Ywr1jPcTUYZ6V3UtFGKSMcoLds0kFqQNEMzCaOtKGYoH2D/y3sg OkLhQl/nyknyn/iypIzb4a18iuzPc+D/FAyeReluzA== X-Received: by 2002:a05:600c:20a:b0:3fe:603e:7fd2 with SMTP id 10-20020a05600c020a00b003fe603e7fd2mr7165320wmi.0.1692708818329; Tue, 22 Aug 2023 05:53:38 -0700 (PDT) Received: from localhost.localdomain ([37.19.214.4]) by smtp.gmail.com with ESMTPSA id x20-20020a05600c2a5400b003fef60005b5sm3426261wme.9.2023.08.22.05.53.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Aug 2023 05:53:37 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Song Gao , "Edgar E. Iglesias" , Richard Henderson , Greg Kurz , Aurelien Jarno , qemu-ppc@nongnu.org, Peter Maydell , Daniel Henrique Barboza , Aleksandar Rikalo , Paolo Bonzini , David Gibson , Jiaxun Yang , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Yoshinori Sato , Nicholas Piggin , Xiaojuan Yang , qemu-arm@nongnu.org, =?utf-8?q?Ph?= =?utf-8?q?ilippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 07/12] target/ppc: Use generic hrev64_i64() in BRH / BSWAP16x8 opcodes Date: Tue, 22 Aug 2023 14:53:31 +0200 Message-ID: <20230822125332.55086-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230822124042.54739-1-philmd@linaro.org> References: <20230822124042.54739-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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Reviewed-by: Nicholas Piggin --- target/ppc/translate.c | 10 +--------- target/ppc/translate/vsx-impl.c.inc | 19 ++----------------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 74796ec7ba..91a9ec2d1c 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -6435,15 +6435,7 @@ static void gen_brw(DisasContext *ctx) /* brh */ static void gen_brh(DisasContext *ctx) { - TCGv_i64 mask = tcg_constant_i64(0x00ff00ff00ff00ffull); - TCGv_i64 t1 = tcg_temp_new_i64(); - TCGv_i64 t2 = tcg_temp_new_i64(); - - tcg_gen_shri_i64(t1, cpu_gpr[rS(ctx->opcode)], 8); - tcg_gen_and_i64(t2, t1, mask); - tcg_gen_and_i64(t1, cpu_gpr[rS(ctx->opcode)], mask); - tcg_gen_shli_i64(t1, t1, 8); - tcg_gen_or_i64(cpu_gpr[rA(ctx->opcode)], t1, t2); + tcg_gen_hrev64_i64(cpu_gpr[rA(ctx->opcode)], cpu_gpr[rS(ctx->opcode)]); } #endif diff --git a/target/ppc/translate/vsx-impl.c.inc b/target/ppc/translate/vsx-impl.c.inc index 0f5b0056f1..639ab7f1bc 100644 --- a/target/ppc/translate/vsx-impl.c.inc +++ b/target/ppc/translate/vsx-impl.c.inc @@ -154,23 +154,8 @@ static void gen_lxvdsx(DisasContext *ctx) static void gen_bswap16x8(TCGv_i64 outh, TCGv_i64 outl, TCGv_i64 inh, TCGv_i64 inl) { - TCGv_i64 mask = tcg_constant_i64(0x00FF00FF00FF00FF); - TCGv_i64 t0 = tcg_temp_new_i64(); - TCGv_i64 t1 = tcg_temp_new_i64(); - - /* outh = ((inh & mask) << 8) | ((inh >> 8) & mask) */ - tcg_gen_and_i64(t0, inh, mask); - tcg_gen_shli_i64(t0, t0, 8); - tcg_gen_shri_i64(t1, inh, 8); - tcg_gen_and_i64(t1, t1, mask); - tcg_gen_or_i64(outh, t0, t1); - - /* outl = ((inl & mask) << 8) | ((inl >> 8) & mask) */ - tcg_gen_and_i64(t0, inl, mask); - tcg_gen_shli_i64(t0, t0, 8); - tcg_gen_shri_i64(t1, inl, 8); - tcg_gen_and_i64(t1, t1, mask); - tcg_gen_or_i64(outl, t0, t1); + tcg_gen_hrev64_i64(outh, inh); + tcg_gen_hrev64_i64(outl, inl); } static void gen_bswap32x4(TCGv_i64 outh, TCGv_i64 outl,