From patchwork Sun Oct 22 23:29:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 737049 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1282938wrl; Sun, 22 Oct 2023 16:34:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2HTfpnq1oZYocJlKToM09kDBmtgqqy3dtThTTXFfVCPYaWW2RVq9VSsGwQKAKCMM7lzmY X-Received: by 2002:ad4:5f05:0:b0:64f:4e64:5962 with SMTP id fo5-20020ad45f05000000b0064f4e645962mr12129745qvb.31.1698017663364; Sun, 22 Oct 2023 16:34:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698017663; cv=none; d=google.com; s=arc-20160816; b=jJBeWxmz7rk8Qan/8ab0CgcwlXLTrMkDRDcTqTVMDsTNeRMPGh4thvaSby5QO9m1Nj Tl25SFYTN/P+Rl6tKW0X723bmjfTbW/WXe/BRYQgov6qGCUoIYjC0t37D9w3wE5u0uxE kDl3nWBxzd4UVp1nIhnygDQ5y8wVs9FIr/e7sMFqN1tB5DVrwsEJyDpZWe+PCUEKh0nn haeXXrVeP1DW/SYYq9cMNS7aDh0gKT8bCleRIwBiOVVzGZFHmV8zN9dFgubqzkQYSVVc od4bksyKfY+/KI4My5gUqGk6dUFSU1ZNIqCEBiMgd4aHDBIILBk6gh6H6LigBjV8zohZ TNNA== 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=z+9x0aUHCZhqCueHYJmPKfWm3jGSgQ6KSkJWFrTbax0=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=Mo0AMF3oEWaL4NJmNHIREGLWlg/iKkYSSoXgnSVmEhrr8bIknAKIISjkCRR9FRerPL 4FRU4XgqJwYsM0MIZofBK4qnjv1/crLD4nHZtIZz3sn6FrLE/e+2mdl76sUSYGeiuLZ7 WUd1dIpKgika5EYNM+EhOXDF7LTcNGAxJgmoK/MMS31kW0JIOCtKooqw2YNWVfOrH15N p6m/W57Vj3onqwdZBgFooCOie++ha5LCuHh2K68SyZ6bStW/m4eYax0YPF8R7boTXbzz z9S78yqxFJg9qwwzG+wv5Zzy/94M8KuMYUI/7Z3rMmx9LAh5OtUuAu0ApEUd4+dB2KOM Auig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=grpbGuht; 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 k15-20020a0cf58f000000b0065af57857cbsi4776457qvm.213.2023.10.22.16.34.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Oct 2023 16:34:23 -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=grpbGuht; 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 1quhx1-0006Yq-R2; Sun, 22 Oct 2023 19:33:43 -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 1quhww-0006S6-6K for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:33:38 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quhws-0007hm-3U for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:33:37 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-6bd32d1a040so2741675b3a.3 for ; Sun, 22 Oct 2023 16:33:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698017613; x=1698622413; 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=z+9x0aUHCZhqCueHYJmPKfWm3jGSgQ6KSkJWFrTbax0=; b=grpbGuht4weHxN3P9hbKrFjfkyCMuDTSu7U+QzFwG1sVP1KRk39tuKwArn6MTD2YAU 21rQJgtXu1peNxvghWo31sZwYFbdT6VwsK77xrDdKO8PEL0rcyDWynfjNveERW+0HOIy eVcbQgdyGRje3cVhoKibPokvXLdRaFmQKYyVCmrVPM5eEiTIoHQnA4VUA6eMdPmLIJbl cdqrUE1oso+1z6LO9doQd5RdsrK3g20OW8tLDtb+uNf0fZKaPo5uQTzJnDcsie/jOZ9A JEK4s6oEZ+e8wMRUVgivFhfuJnBlNxYm35JMq57G3eEna538Ritgg8oDefhc4JOm7afS afDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698017613; x=1698622413; 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=z+9x0aUHCZhqCueHYJmPKfWm3jGSgQ6KSkJWFrTbax0=; b=S+p2usrLfG1/jkN13Y3+mbSoRPWQtiyVL/e61pF9EGk4Fwch5Ah/N5jDqxdw6d1Agl kIdB8VExg4WTrlm6G44AWJ19E98J5cP87pl1u41rlqdEc8AfQKkV3HSeT2Cc6C7Bfiiv IA9wLfdOz+B1EfjUIvQAwzmHVmUGKvUwAkcKGr73s6v9e2nYEWIXqQwZkTCSM1Z8PXxs u7P7RHeosxBZpUtSKzjcr+d+BtHGa7ohz08BXwRHCAIBQ4JEEriw5blvcD4d/rVgrYet eZKy57KQE4h4aMAOdIF5bVEaY3ipm5s0U3SREfvMQZq+JUdI2CmjAcp2FBXz2FZetW6v GAMw== X-Gm-Message-State: AOJu0YxSWdKjDi9vYnBeaqIREttxnaqDFgryp27oxQJ1GVp6s3Y1Xgu8 jp+CcmUQyA0AGo/3k72O7AF+8r+0Vw+S1z0TTnc= X-Received: by 2002:a05:6a00:703:b0:690:fa09:61d3 with SMTP id 3-20020a056a00070300b00690fa0961d3mr7135926pfl.15.1698017612750; Sun, 22 Oct 2023 16:33:32 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id fe12-20020a056a002f0c00b0066a4e561beesm5182855pfb.173.2023.10.22.16.33.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 16:33:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v5 69/94] target/sparc: Use tcg_gen_vec_{add,sub}* Date: Sun, 22 Oct 2023 16:29:07 -0700 Message-Id: <20231022232932.80507-70-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231022232932.80507-1-richard.henderson@linaro.org> References: <20231022232932.80507-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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 Replace the local helpers for the same integer operations. Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/helper.h | 12 -------- target/sparc/translate.c | 15 +++++----- target/sparc/vis_helper.c | 59 --------------------------------------- 3 files changed, 7 insertions(+), 79 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index 790752467f..dd1721a340 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -137,18 +137,6 @@ DEF_HELPER_FLAGS_2(fpack16, TCG_CALL_NO_RWG_SE, i32, i64, i64) DEF_HELPER_FLAGS_3(fpack32, TCG_CALL_NO_RWG_SE, i64, i64, i64, i64) DEF_HELPER_FLAGS_2(fpackfix, TCG_CALL_NO_RWG_SE, i32, i64, i64) DEF_HELPER_FLAGS_3(bshuffle, TCG_CALL_NO_RWG_SE, i64, i64, i64, i64) -#define VIS_HELPER(name) \ - DEF_HELPER_FLAGS_2(f ## name ## 16, TCG_CALL_NO_RWG_SE, \ - i64, i64, i64) \ - DEF_HELPER_FLAGS_2(f ## name ## 16s, TCG_CALL_NO_RWG_SE, \ - i32, i32, i32) \ - DEF_HELPER_FLAGS_2(f ## name ## 32, TCG_CALL_NO_RWG_SE, \ - i64, i64, i64) \ - DEF_HELPER_FLAGS_2(f ## name ## 32s, TCG_CALL_NO_RWG_SE, \ - i32, i32, i32) - -VIS_HELPER(padd) -VIS_HELPER(psub) #define VIS_CMPHELPER(name) \ DEF_HELPER_FLAGS_2(f##name##16, TCG_CALL_NO_RWG_SE, \ i64, i64, i64) \ diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 50f5a91d2d..e65335402f 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -25,9 +25,8 @@ #include "exec/helper-proto.h" #include "exec/exec-all.h" #include "tcg/tcg-op.h" - +#include "tcg/tcg-op-gvec.h" #include "exec/helper-gen.h" - #include "exec/translator.h" #include "exec/log.h" #include "asi.h" @@ -5350,15 +5349,15 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) break; case 0x050: /* VIS I fpadd16 */ CHECK_FPU_FEATURE(dc, VIS1); - gen_ne_fop_DDD(dc, rd, rs1, rs2, gen_helper_fpadd16); + gen_ne_fop_DDD(dc, rd, rs1, rs2, tcg_gen_vec_add16_i64); break; case 0x051: /* VIS I fpadd16s */ CHECK_FPU_FEATURE(dc, VIS1); - gen_ne_fop_FFF(dc, rd, rs1, rs2, gen_helper_fpadd16s); + gen_ne_fop_FFF(dc, rd, rs1, rs2, tcg_gen_vec_add16_i32); break; case 0x052: /* VIS I fpadd32 */ CHECK_FPU_FEATURE(dc, VIS1); - gen_ne_fop_DDD(dc, rd, rs1, rs2, gen_helper_fpadd32); + gen_ne_fop_DDD(dc, rd, rs1, rs2, tcg_gen_vec_add32_i64); break; case 0x053: /* VIS I fpadd32s */ CHECK_FPU_FEATURE(dc, VIS1); @@ -5366,15 +5365,15 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) break; case 0x054: /* VIS I fpsub16 */ CHECK_FPU_FEATURE(dc, VIS1); - gen_ne_fop_DDD(dc, rd, rs1, rs2, gen_helper_fpsub16); + gen_ne_fop_DDD(dc, rd, rs1, rs2, tcg_gen_vec_sub16_i64); break; case 0x055: /* VIS I fpsub16s */ CHECK_FPU_FEATURE(dc, VIS1); - gen_ne_fop_FFF(dc, rd, rs1, rs2, gen_helper_fpsub16s); + gen_ne_fop_FFF(dc, rd, rs1, rs2, tcg_gen_vec_sub16_i32); break; case 0x056: /* VIS I fpsub32 */ CHECK_FPU_FEATURE(dc, VIS1); - gen_ne_fop_DDD(dc, rd, rs1, rs2, gen_helper_fpsub32); + gen_ne_fop_DDD(dc, rd, rs1, rs2, tcg_gen_vec_add32_i64); break; case 0x057: /* VIS I fpsub32s */ CHECK_FPU_FEATURE(dc, VIS1); diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index 3afdc6975c..7763b16c24 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -275,65 +275,6 @@ uint64_t helper_fexpand(uint64_t src1, uint64_t src2) return d.ll; } -#define VIS_HELPER(name, F) \ - uint64_t name##16(uint64_t src1, uint64_t src2) \ - { \ - VIS64 s, d; \ - \ - s.ll = src1; \ - d.ll = src2; \ - \ - d.VIS_W64(0) = F(d.VIS_W64(0), s.VIS_W64(0)); \ - d.VIS_W64(1) = F(d.VIS_W64(1), s.VIS_W64(1)); \ - d.VIS_W64(2) = F(d.VIS_W64(2), s.VIS_W64(2)); \ - d.VIS_W64(3) = F(d.VIS_W64(3), s.VIS_W64(3)); \ - \ - return d.ll; \ - } \ - \ - uint32_t name##16s(uint32_t src1, uint32_t src2) \ - { \ - VIS32 s, d; \ - \ - s.l = src1; \ - d.l = src2; \ - \ - d.VIS_W32(0) = F(d.VIS_W32(0), s.VIS_W32(0)); \ - d.VIS_W32(1) = F(d.VIS_W32(1), s.VIS_W32(1)); \ - \ - return d.l; \ - } \ - \ - uint64_t name##32(uint64_t src1, uint64_t src2) \ - { \ - VIS64 s, d; \ - \ - s.ll = src1; \ - d.ll = src2; \ - \ - d.VIS_L64(0) = F(d.VIS_L64(0), s.VIS_L64(0)); \ - d.VIS_L64(1) = F(d.VIS_L64(1), s.VIS_L64(1)); \ - \ - return d.ll; \ - } \ - \ - uint32_t name##32s(uint32_t src1, uint32_t src2) \ - { \ - VIS32 s, d; \ - \ - s.l = src1; \ - d.l = src2; \ - \ - d.l = F(d.l, s.l); \ - \ - return d.l; \ - } - -#define FADD(a, b) ((a) + (b)) -#define FSUB(a, b) ((a) - (b)) -VIS_HELPER(helper_fpadd, FADD) -VIS_HELPER(helper_fpsub, FSUB) - #define VIS_CMPHELPER(name, F) \ uint64_t name##16(uint64_t src1, uint64_t src2) \ { \