From patchwork Thu Oct 26 00:15:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 738227 Delivered-To: patch@linaro.org Received: by 2002:adf:f842:0:b0:32d:baff:b0ca with SMTP id d2csp555067wrq; Wed, 25 Oct 2023 17:26:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEUmVyd/OhPVtjq2hjkqlWDOZr/PlcKXysh29v+fg1rorBx2tMvsPYrRZSOTPza0ZEXsHNU X-Received: by 2002:a1c:6a08:0:b0:406:52f1:7e6f with SMTP id f8-20020a1c6a08000000b0040652f17e6fmr14211440wmc.12.1698279972077; Wed, 25 Oct 2023 17:26:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698279972; cv=none; d=google.com; s=arc-20160816; b=azWzhXtmAoTKvHKn+Jwrij5bOHPxZL+dzxGR5KdpDzqWgiIQgZM5wBBuceoGqXQrMd F6dR7FiOj279wbh369etwbWLhdhFIU2v5wQ6WVVdagl7CNRrz9WYsnIUbtU+p6ZdbkY1 yMICrRhMzG8ZMU8tgmdHtvab9ok5xwfNGY56Bn8Nd95cXLpiN1tO2Onaj+6UNkwkuT9D 1gB8/EWInxBxkj62hK4v09RG6KzPjY3jPSYza0bpa8Bl9EpyoBJm8sbH2JeRtdBIVsnd 4MyorkUqVBMyT+sDViPGfjhhC5OVNXsyR0NcUrbUn9kvR3608Kyf6PUrc9ICehE+a5iO 5nsQ== 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=Igz27nAt1G4kcSZCVnTvSOQq2ldt0OLkmfH9kT7xTEQ=; fh=rYI8DiHAAFX3O5g969KmOAQ7d45Sb8OxQX1+DywGDk4=; b=cGhJkGt32cReXcBsVqMX2VWXu2sk5/SVkxBB4f0Q6HJczYOEvmnpOS3+jjn3dqMtgZ cJgXpova5PJq1/gIGqhucIMy8hK1yEyTqAchlQAXydOFW8L72M/YXyXX6M8w1NItfJx3 evb85Ia6M8Re5UK+qCYkNgVe8BxWMqZ33ME+uU62FY4dYMR/VPK8q+ZcplKrtH3wUP0s komD46MNCqefUhFazGUVtZlnOFCIfMtQIrePPGC9S5ow6L/ddj1hgG3RzORzzd71tq4o y/YSSWGlSBj2c3KtoPQTrPxHSiwjdjF9NbYycYDp0f8lGn/N3UMiw0z38Aw0ooggPLOe CRNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B1SP3Ha7; 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 hg26-20020a05600c539a00b004083c9e5a4csi789494wmb.114.2023.10.25.17.26.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2023 17:26: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=B1SP3Ha7; 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 1qvoAG-00063r-Of; Wed, 25 Oct 2023 20:23:57 -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 1qvo9g-00033s-MV for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:23:21 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvo9Z-0008G0-UH for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:23:20 -0400 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-27d4b280e4eso219803a91.1 for ; Wed, 25 Oct 2023 17:23:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698279792; x=1698884592; 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=Igz27nAt1G4kcSZCVnTvSOQq2ldt0OLkmfH9kT7xTEQ=; b=B1SP3Ha7pj7SXx517FwGyw60E1Dq8TRR3UMfXReVznf6getWdawLEEGSVn+V4CTF1y dc0J3nEMioXhk1M1nXFb5OmbaD1BLdxeRM5qyfObGs+AMllG8y/CekDIBhAwF/lyUy/O 2eSgKDIxJTwoS6OnIQ8tDP1ibavf2pnL0P5a4mXYbfk2D5+wB+IaC9+gytNHmIbCJkdw GBmfJUjxSQ7n6ZX3VLhQMq6NHH72om4FbYOBzWl8eu04PY0+CcZB63GmIK9EEe3jNt3x mcPCFlUfQrlI2IVsrggnN0Z3JqPY7OdJ5RodZC2HAOikeLvL9xjwZozqc/39oqJhK8hl c9Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698279792; x=1698884592; 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=Igz27nAt1G4kcSZCVnTvSOQq2ldt0OLkmfH9kT7xTEQ=; b=NurUcrQAL+RiXSowuZcovHgHPHHbvl5sGKYafKup7IwEdyfZTyk+yLsRbFhiw457bH 0RsAI/HG3IqN9WroE/8GOkdQzL3HfpRmmW9Cs0iMf1P1rqkPWZ1J5qkwcUHdq1MbNto3 G1Ho7/ODv1uwuqtIOK2DcV4TS+1xfSy1cDRqRTLieSoh2OEWMa8JFNTE4HGQYRIF+06Z z1Dm+1T6EdMDPMLMczPOVDWqgUyZcagy1Mn8myHNYKfcVcwffiYwFSjEvQrfnrhGzRs7 k7KZuvzM+z6rWyfvgcqji8MRGFyApnWz792dpoVPDp811UZcsM9PHt2Zdp0x1CSm3Mv4 47xA== X-Gm-Message-State: AOJu0YyOW27FSsKf2Imykf1QXBHgnqwQ6iVW4x8PNab9eDmogCiaPcbC PiPJfUPglF6W8HHMDTP8x32KmWlR7eBHT992KqQ= X-Received: by 2002:a17:90a:b396:b0:27c:ecec:8854 with SMTP id e22-20020a17090ab39600b0027cecec8854mr1512703pjr.7.1698279792688; Wed, 25 Oct 2023 17:23:12 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id 9-20020a17090a0cc900b0027463889e72sm499870pjt.55.2023.10.25.17.23.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 17:23:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 80/94] target/sparc: Move FSMULD to decodetree Date: Wed, 25 Oct 2023 17:15:28 -0700 Message-Id: <20231026001542.1141412-110-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231026001542.1141412-1-richard.henderson@linaro.org> References: <20231026001542.1141412-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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 Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 1 + target/sparc/translate.c | 43 +++++++++++++++++++++------------------ 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index f18fd99476..6817d52ca2 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -260,6 +260,7 @@ FMULq 10 ..... 110100 ..... 0 0100 1011 ..... @r_r_r FDIVs 10 ..... 110100 ..... 0 0100 1101 ..... @r_r_r FDIVd 10 ..... 110100 ..... 0 0100 1110 ..... @r_r_r FDIVq 10 ..... 110100 ..... 0 0100 1111 ..... @r_r_r +FsMULd 10 ..... 110100 ..... 0 0110 1001 ..... @r_r_r FdTOx 10 ..... 110100 00000 0 1000 0010 ..... @r_r2 FxTOd 10 ..... 110100 00000 0 1000 1000 ..... @r_r2 FiTOs 10 ..... 110100 00000 0 1100 0100 ..... @r_r2 diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 94ad75b897..6626042776 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1669,22 +1669,6 @@ static void gen_ne_fop_QQ(DisasContext *dc, int rd, int rs, } #endif -static void gen_fop_DFF(DisasContext *dc, int rd, int rs1, int rs2, - void (*gen)(TCGv_i64, TCGv_ptr, TCGv_i32, TCGv_i32)) -{ - TCGv_i64 dst; - TCGv_i32 src1, src2; - - src1 = gen_load_fpr_F(dc, rs1); - src2 = gen_load_fpr_F(dc, rs2); - dst = gen_dest_fpr_D(dc, rd); - - gen(dst, tcg_env, src1, src2); - gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); - - gen_store_fpr_D(dc, rd, dst); -} - static void gen_fop_QDD(DisasContext *dc, int rd, int rs1, int rs2, void (*gen)(TCGv_ptr, TCGv_i64, TCGv_i64)) { @@ -4931,6 +4915,28 @@ TRANS(FSUBd, ALL, do_env_ddd, a, gen_helper_fsubd) TRANS(FMULd, ALL, do_env_ddd, a, gen_helper_fmuld) TRANS(FDIVd, ALL, do_env_ddd, a, gen_helper_fdivd) +static bool trans_FsMULd(DisasContext *dc, arg_r_r_r *a) +{ + TCGv_i64 dst; + TCGv_i32 src1, src2; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + if (!(dc->def->features & CPU_FEATURE_FSMULD)) { + return raise_unimpfpop(dc); + } + + gen_op_clear_ieee_excp_and_FTT(); + dst = gen_dest_fpr_D(dc, a->rd); + src1 = gen_load_fpr_F(dc, a->rs1); + src2 = gen_load_fpr_F(dc, a->rs2); + gen_helper_fsmuld(dst, tcg_env, src1, src2); + gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); + gen_store_fpr_D(dc, a->rd, dst); + return advance_pc(dc); +} + static bool do_dddd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i64, TCGv_i64, TCGv_i64)) { @@ -5041,11 +5047,8 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x47: /* fsubq */ case 0x4b: /* fmulq */ case 0x4f: /* fdivq */ - g_assert_not_reached(); /* in decodetree */ case 0x69: /* fsmuld */ - CHECK_FPU_FEATURE(dc, FSMULD); - gen_fop_DFF(dc, rd, rs1, rs2, gen_helper_fsmuld); - break; + g_assert_not_reached(); /* in decodetree */ case 0x6e: /* fdmulq */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_QDD(dc, rd, rs1, rs2, gen_helper_fdmulq);