From patchwork Fri Oct 13 21:28:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 733335 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1680432wrv; Fri, 13 Oct 2023 14:38:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHo5aUJ427SgQ75flb0z/Su0RuPT8re3VTrhsJzz1IJNODE7hmvETljCoiveNm24RsQHb8g X-Received: by 2002:a25:c705:0:b0:d9a:c61f:e5f1 with SMTP id w5-20020a25c705000000b00d9ac61fe5f1mr5434826ybe.32.1697233132548; Fri, 13 Oct 2023 14:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697233132; cv=none; d=google.com; s=arc-20160816; b=QDW78I1N1jEjiuLiK95sTeaH70crnQCAtNlvjrnOIR28ZTaFMzhK3FshGMoiPRooyr VHRmAdtY2G9iZJ6czamB0yZWkpNNkbIIrEkqqyqPLjwrZTtmZqm2hoeDe64OQANP0m4R vhDrDFoDjSZyXKrkJSZe3yB+7HbWF6cNKod3EYo3R/Jo04KkjW+KK6p4v3Plc4/atMit VL+dMfyb1siPSnYJ0FCc7/CWNWPwpzvaR+SM+xifxAuIe3pOkt8pKoZYlXXP8bMq8Ky/ Os+tY/JL9CVzxmo7zAZN3LnewlopYfkH4XO0z5qrXBAy28q/Pma6AJIEL5YEysoXxuvl Wl7Q== 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=bKUnd2j1DB/Zlx01jGlKEJ96jzWPgB0b2NT1FKdEv6k=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=yqV7PjC0RNdzN2LBw4fSQQ1WAd8UdAsAnouy2jIWp0raQBIf8CDNYiF9WyMK4yB575 VVNwJLUfWdNfs/ghRtYoM7uptEAtCIm3NkyQJUp3ID1xkh1+8POEqpHTasXqec1NmpjH FH+NBXacGpajNOcWCoDMGs6ToIkAA5sKXOQEAjEf+9+HdjUkgNYSXcH9cfdQC8cTFvP/ IEW3GvTPWNoyzH2AIB0OYJalSXjoe5jJI+gpE74LP1U4sxXYBUMw0FwNtbBmOOl5B7wL nnC0ppTcgg/6jL/Ldfit/OKxstg6u8MHzbOSsFDQoOmCKGugAimtyD6kMnUbAgF6RCxu qxBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ADrL3cbz; 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-20020a056214212700b006561d609607si2062233qvc.466.2023.10.13.14.38.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 14:38:52 -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=ADrL3cbz; 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 1qrPm5-00010N-5X; Fri, 13 Oct 2023 17:32:49 -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 1qrPm2-0000fg-R1 for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:32:46 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrPm0-0001TK-Mw for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:32:46 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6b1ef786b7fso1080637b3a.3 for ; Fri, 13 Oct 2023 14:32:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697232763; x=1697837563; 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=bKUnd2j1DB/Zlx01jGlKEJ96jzWPgB0b2NT1FKdEv6k=; b=ADrL3cbz4A60cVhy6A2WBluBxTEwuodMHrXmnami/uhLFK7cSpU9sUNROK7uqCL+9n uxxyZ54nRXs4LfXMu6C8tT16fSz0/gtYP/pVvQWBkjUQR/OX/KKRfGAG7kpzxJdBiXCW L5cDnSnYVHtDv5J5naxQiz0yZtmHTyLTwd8yEzt8csRVyrXwiqRReVvHAw7IY5uAKcPO uBJIsqDub4HslrgOTs7D+kr34qnqnu2AM2bqFazRc2fUWyIy2VZcCS6DZwUiukg7WlLp KxYifSX2CmhZ4gdJiMuhm26yoP3l19HIXCPZfasGrjayQboJ92c+yUJeSWSq/qeEZ1y2 zeEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697232763; x=1697837563; 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=bKUnd2j1DB/Zlx01jGlKEJ96jzWPgB0b2NT1FKdEv6k=; b=LlbfUNnt5h5P8Gqh1DBuhDfwv99U7g8VwBlUg4ttO0qOE6xxdmQSVrnWgQXft3pAlU qgq1FEBZER54i7p5oiTytVbzBphPMVzmj3QiLI9g+0EfTP9lAxi5ED/PglFZTZsLR/EF DpliLTwG+V3Usu5JXM93EHmJ3GkpPeIPueW6U0os2T7rO3PlhZ1Kb/Z+uTdLz5KSdUT9 tCCUIStuihO2Ip7e7SXVmj8Sa52eGxMerPS7JFXcabHyCH/6peZAodAclkd+2HbrZdGe CXHpWUCdfM2aCG5qY2wAcwIeeJWTCmfsY72/aUdXROrSgL1AD+Upav8PNyP4qhnijloY 5BLg== X-Gm-Message-State: AOJu0YwUnLwAxNk3SaItZC4tQ06+i2RpnO77MzUlpByDWNYv9thRYcPD 1Nz2R1nDxRqielXBUAYWI3hfRcINXz1olYYKEEQ= X-Received: by 2002:a05:6a00:2e23:b0:68a:59c6:c0a6 with SMTP id fc35-20020a056a002e2300b0068a59c6c0a6mr37374038pfb.24.1697232763301; Fri, 13 Oct 2023 14:32:43 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id j5-20020aa78d05000000b0068842ebfd10sm13977191pfe.160.2023.10.13.14.32.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 14:32:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 60/85] target/sparc: Use tcg_gen_vec_{add,sub}* Date: Fri, 13 Oct 2023 14:28:21 -0700 Message-Id: <20231013212846.165724-61-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231013212846.165724-1-richard.henderson@linaro.org> References: <20231013212846.165724-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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. 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 a9ee8e6b9f..8d20258d08 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -138,18 +138,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 0a1ebb62e3..3b6f4bef95 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" @@ -5337,15 +5336,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); @@ -5353,15 +5352,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) \ { \