From patchwork Sat Oct 21 05:31:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736640 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp633670wrl; Fri, 20 Oct 2023 22:41:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnH2Ci34wbJTXF7NHo6+g0lniQe/oSNBxSfh1htTThA6nPkODZaK24TSUZhqX9Oao3luRs X-Received: by 2002:ac8:5fc1:0:b0:412:24e6:a492 with SMTP id k1-20020ac85fc1000000b0041224e6a492mr4011698qta.60.1697866869114; Fri, 20 Oct 2023 22:41:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697866869; cv=none; d=google.com; s=arc-20160816; b=kdfdQ6RaOvZcpXt5I4r044NWBWX6fN057P+TBtBv42Elz8MEKw9i/tdSRCct52ztKS H2/LJYVxl2xHF04gvBUXQFY4KFK3lbZ9p1zUkg50DGq9O+uAx3mhbQecE2beGlimodCY krQrr4J8WE+YX1h2YsMtGD5jOk3zF822aaQe+tUQYyRkxSS2C3aPqRH/1iGa0mnA2gTK 5fKwNBh1jRRezRpHbnZNAQgyNPdmwEznsVrYMW5mYcT0ZFgQD1edHMJ3iFAKJsdfBtae EuRtzF7eh9y9fq0TiXSX0GCE7ETvWurpozqyltdl6nP00VnFwcY35ZKkLDP9ZbC1xnY/ RrSQ== 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=gX1Xk9WxJkRM5EeOMgATFcD8wFIWGwle7B65OdBVJTA=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=IpHIiXanIWMKsUzsYLzkC+s01/yuzfhf1cQPnZg9LVHTiecWawsHV+HFT4xjIMLLQy +MlMWFgCFmeZ0GiE8FmEkmC7SZ4js5J+WBMZkW4KNsELIpigZWoHjZpcL7OP/EEmwuMt lTdjYT8G3KmmOwphvLaCvjFhqCTTMyKlfWJOc6m/FOinmS/2UZ5a6ZUXQC4j3JWxHf99 BaxaB3ip0VGCwNQpps2nv/YjxBy51lipxMx5b7upPUVfOqGnkV+HbBP5YHNhdw7/pHbc jF6pe6QMokkhoQ6UIbrL1BvjZ7pMuJ+KzHWalV/WFgE9+bHSYRFuJA7821XB1tLVKO49 tdTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mYvvNAo0; 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-20020a05622a148c00b00417f199f9e5si2538848qtx.738.2023.10.20.22.41.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 22:41:09 -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=mYvvNAo0; 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 1qu4eb-0003M6-2C; Sat, 21 Oct 2023 01:36:05 -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 1qu4eY-0003KC-Mv for qemu-devel@nongnu.org; Sat, 21 Oct 2023 01:36:02 -0400 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qu4eT-0001A7-8w for qemu-devel@nongnu.org; Sat, 21 Oct 2023 01:36:02 -0400 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3b3ec45d6e9so1049588b6e.0 for ; Fri, 20 Oct 2023 22:35:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697866556; x=1698471356; 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=gX1Xk9WxJkRM5EeOMgATFcD8wFIWGwle7B65OdBVJTA=; b=mYvvNAo0y43kJXZtZ4zRsbbF6n3hNrE1aKTv14j2XAe0VMfV940lz3z8aavBJz/urM GW12KgFiS9uAxEmHOnJPOJkJOj8Mx1iV4WZrRs7QPXZIduNQsdB2ffdgMfcocveHPjvm rbP5ugzphTASpYV8VGdlayqy6wuIbNNnWlXDIUF7hhZ3lF6ZoMF5VlkrBFVvWPlpVH4H Yx1EkfKOdzBMGMZERp1DXCJ46qjc3IQkLdg9kbG5YdYdYoKoWEYWPZ51jdbEF038wpHT fHc9fHlERzMhw6HgmrOqGZkzbWQSTq5tDMkrKBcOXGJYQfrV52E8kINb56QeCD52KzZw L15w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697866556; x=1698471356; 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=gX1Xk9WxJkRM5EeOMgATFcD8wFIWGwle7B65OdBVJTA=; b=g/H7VB3pBSVCGZ2gThdZfPoSSOc3MiTQ+XP/Ih+wwkGIMiUEjOlNAs7aimRV6FsqNC M2bvpL/Sj+8QZTKVp8oHD5YHcHcKDr6ogullNyOgt9JkWnnTBgdAdbTvl5mR8PagR9Xw 4Ij1cfiPWCiD6iSkLDC5pfMmw3y47LrxHg4QgxWIJvSKDYxW4hczNBldgfYiz0K/Uuqp GOe1gN0XT2W4ddEYC1nFOS5b4HIqt5MC/gAfgb/8GimpIBsPqizZ4ZS8JO6SgbR/zQUx DAwqyabeZZg/xOHd4bLkdK6AEwdEq+3U1JHA+F+qLCj+Ub9jn/gfMxhw5qeqZEEBDAeE 3vgA== X-Gm-Message-State: AOJu0YxeuuQDQ7mX1xewGvmNObSPIWZATe3qtOHLjjweR3PvRM55wBYI VE9X9DByJpe0W44JnuTKmcIC+xxdZsFxUDiEFR8= X-Received: by 2002:a54:4e84:0:b0:3af:75e2:4c34 with SMTP id c4-20020a544e84000000b003af75e24c34mr3702287oiy.50.1697866556223; Fri, 20 Oct 2023 22:35:56 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id h1-20020a62b401000000b00690d255b5a1sm2427978pfn.217.2023.10.20.22.35.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 22:35:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 68/90] target/sparc: Move PDIST to decodetree Date: Fri, 20 Oct 2023 22:31:36 -0700 Message-Id: <20231021053158.278135-69-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231021053158.278135-1-richard.henderson@linaro.org> References: <20231021053158.278135-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::233; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x233.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 Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 1 + target/sparc/translate.c | 41 +++++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 75832ea503..9ac2a715c0 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -277,6 +277,7 @@ FABSd 10 ..... 110100 00000 0 0000 1010 ..... @r_r2 FMUL8ULx16 10 ..... 110110 ..... 0 0011 0111 ..... @r_r_r FMULD8SUx16 10 ..... 110110 ..... 0 0011 1000 ..... @r_r_r FMULD8ULx16 10 ..... 110110 ..... 0 0011 1001 ..... @r_r_r + PDIST 10 ..... 110110 ..... 0 0011 1110 ..... @r_r_r FPMERGE 10 ..... 110110 ..... 0 0100 1011 ..... @r_r_r FEXPAND 10 ..... 110110 ..... 0 0100 1101 ..... @r_r_r diff --git a/target/sparc/translate.c b/target/sparc/translate.c index e80a902c8d..0c5ad342bc 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -68,6 +68,7 @@ #define gen_helper_fmuld8ulx16 ({ g_assert_not_reached(); NULL; }) #define gen_helper_fpmerge ({ g_assert_not_reached(); NULL; }) #define gen_helper_fexpand ({ g_assert_not_reached(); NULL; }) +#define gen_helper_pdist ({ g_assert_not_reached(); NULL; }) #define FSR_LDXFSR_MASK ({ qemu_build_not_reached(); 0; }) #define FSR_LDXFSR_OLDMASK ({ qemu_build_not_reached(); 0; }) # ifdef CONFIG_USER_ONLY @@ -1676,21 +1677,6 @@ static void gen_gsr_fop_DDD(DisasContext *dc, int rd, int rs1, int rs2, gen_store_fpr_D(dc, rd, dst); } - -static void gen_ne_fop_DDDD(DisasContext *dc, int rd, int rs1, int rs2, - void (*gen)(TCGv_i64, TCGv_i64, TCGv_i64, TCGv_i64)) -{ - TCGv_i64 dst, src0, src1, src2; - - src1 = gen_load_fpr_D(dc, rs1); - src2 = gen_load_fpr_D(dc, rs2); - src0 = gen_load_fpr_D(dc, rd); - dst = gen_dest_fpr_D(dc, rd); - - gen(dst, src0, src1, src2); - - gen_store_fpr_D(dc, rd, dst); -} #endif static void gen_fop_QQ(DisasContext *dc, int rd, int rs, @@ -5020,6 +5006,26 @@ TRANS(FXNORd, VIS1, do_ddd, a, tcg_gen_eqv_i64) TRANS(FORNOTd, VIS1, do_ddd, a, tcg_gen_orc_i64) TRANS(FORd, VIS1, do_ddd, a, tcg_gen_or_i64) +static bool do_dddd(DisasContext *dc, arg_r_r_r *a, + void (*func)(TCGv_i64, TCGv_i64, TCGv_i64, TCGv_i64)) +{ + TCGv_i64 dst, src0, src1, src2; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + dst = gen_dest_fpr_D(dc, a->rd); + src0 = gen_load_fpr_D(dc, a->rd); + src1 = gen_load_fpr_D(dc, a->rs1); + src2 = gen_load_fpr_D(dc, a->rs2); + func(dst, src0, src1, src2); + gen_store_fpr_D(dc, a->rd, dst); + return advance_pc(dc); +} + +TRANS(PDIST, VIS1, do_dddd, a, gen_helper_pdist) + #define CHECK_IU_FEATURE(dc, FEATURE) \ if (!((dc)->def->features & CPU_FEATURE_ ## FEATURE)) \ goto illegal_insn; @@ -5429,6 +5435,7 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x039: /* VIS I fmuld8ulx16 */ case 0x04b: /* VIS I fpmerge */ case 0x04d: /* VIS I fexpand */ + case 0x03e: /* VIS I pdist */ g_assert_not_reached(); /* in decodetree */ case 0x020: /* VIS I fcmple16 */ CHECK_FPU_FEATURE(dc, VIS1); @@ -5504,10 +5511,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) gen_helper_fpackfix(cpu_dst_32, cpu_gsr, cpu_src1_64); gen_store_fpr_F(dc, rd, cpu_dst_32); break; - case 0x03e: /* VIS I pdist */ - CHECK_FPU_FEATURE(dc, VIS1); - gen_ne_fop_DDDD(dc, rd, rs1, rs2, gen_helper_pdist); - break; case 0x048: /* VIS I faligndata */ CHECK_FPU_FEATURE(dc, VIS1); gen_gsr_fop_DDD(dc, rd, rs1, rs2, gen_faligndata);