From patchwork Fri Oct 13 21:28: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: 733299 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1679327wrv; Fri, 13 Oct 2023 14:34:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFm/788j2DEpeXOjSP/5Pnw5H1L//2jWVOE2O62OcbK249lPC5G7qn0X30nnVYO1zMKiOdr X-Received: by 2002:ae9:e914:0:b0:774:187d:88a8 with SMTP id x20-20020ae9e914000000b00774187d88a8mr27795459qkf.41.1697232889918; Fri, 13 Oct 2023 14:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697232889; cv=none; d=google.com; s=arc-20160816; b=hny/tCRkkM4GBDKrzQQrMukT+gYb3GwpVSVbbD5TMijnjxPAHi5c2zXpOJIx5DFjY0 F0xRRv3ebgGhXcvmBio+njaHNWMucM9z6bDbYV9oe3sEbVBCGX6StyNE5sIxVNcVeFxl 20vcZSl6pOssG+GS0Y2JlpUkLGY1wjqfX3QjN8LbDOEhJfWnkCJrPqy4ovvICRkjUqqU Rf0Fo+o/DKxl2SRqbZfob4mV676+r0CtPUDZy+IYs23hhJkXO/WKtis4eWbh+jriLfsh FD2OnHMDxJKs74zwPoGmCodmH4UMc5Mo9ExmQYLxxWBpD0LZUrXqfBniVJP3VE0PtPQP cA5A== 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=sqCqC4DlFu4JsqRYhv8fNVQFIpbt1Oh75jrfAYFYWQA=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=PQmGH4foQhgBUsw+GOaCcmEzns90RSUiED9d5/CeK37YNCZR6/9FuguCiLKmwKj+yI FcyHPRSdKQbQgxRQsB3yN+9NEc31gh63VyIn0X4jPeVvgYhIIYob6Zf6lHKAs2QIVLHM Qb0dcr/ADESTZFIEbxvsP3eDqOmB8bFywGL7KeKeGspSunq2C5a2Ml3mipb58cgoxIUO GBPrtLskndDDbQaCE3hNGCW2CUbpKlUn00dWQ+cTpv4OG9pJcNrz7gpc6DFMdZzCXMkS NPhXnCtE9nF/HkYg911ejxSTZPqhP8mLO4+pCIu9XZAsTIumEFzrvw9rw7x7mnCVsxhP UbeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EUG3Hh0S; 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 qd11-20020a05620a658b00b007756b12c2eesi1775464qkn.26.2023.10.13.14.34.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 14:34:49 -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=EUG3Hh0S; 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 1qrPmC-0001yM-Cq; Fri, 13 Oct 2023 17:32:56 -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 1qrPm9-0001br-6m for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:32:53 -0400 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrPm7-0001Xn-9z for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:32:52 -0400 Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-6c4b9e09528so1604689a34.3 for ; Fri, 13 Oct 2023 14:32:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697232770; x=1697837570; 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=sqCqC4DlFu4JsqRYhv8fNVQFIpbt1Oh75jrfAYFYWQA=; b=EUG3Hh0Stq1p6gWU0Fte0hB+9sD5dve5JEmTO26mXDGJmTE3FW0gf2li/G+aNBd2yV +oTiD4uPM3oKViP0nQ6w1xWlzZ7KS7yx93GP7dt3rmklGgx0+HtMuSnRO2TRs8c7J96R k23GVWq5/Nsb7zQKZL4VlFplVaKSJuOW6c3JQndBQOwnRomwjlZ10lqQQ6GXPceM/QcA PjRFCs3kOfBSy+Kh6BeK/I+qAfJKUDonX2ygz4dz8YyBpyY5ZzFiTQVc61p19OgT9+i+ MEmOWq9m5shttZM23fw2GEzkb/lfnsTsvhtYW7jj3iugafKBSyzbz6w2Xksr5/doMYS5 lxew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697232770; x=1697837570; 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=sqCqC4DlFu4JsqRYhv8fNVQFIpbt1Oh75jrfAYFYWQA=; b=Aa/P6IBAveHTn8hawwkvNtcxXzzNFlXiIJZoZhCzSbObpm1qNNIe7ruesm4D3DJGlV NuzA7z4V2bus36BJ5o+fP2FsXaov0HAV45KLuc7uheDHyiQRP4rYbim7hCAex/LBwiXG 4gs7vXVF9egQVbhdiyns60WwakCgTqwA/nZR+b5Mqv1ifybuZzRXosdVLbVN2YQ2gDFj SXEuh6RNCGfBGMp9904+BoqoMvyKArfSigfQNh5ZuMXr/i2MU30szAGxvM9Ipk4m1lUX l6b5/Wg19OsqbjOgdCG6B0kKWgE6/GC9yhigyeO8ru1yVtpVi5QLAbzROvo+B5RCrRrT vThQ== X-Gm-Message-State: AOJu0YwuQF0eMGikmB3M5VPldJ3wIIQzzu2cscSCOmAZjLwuQgVw8aLO oZduoyUNRB8CdwM1TmSRXxAXxFNxvClf7zeT7Wo= X-Received: by 2002:a05:6830:1d47:b0:6bc:96c3:b6ce with SMTP id p7-20020a0568301d4700b006bc96c3b6cemr29008902oth.16.1697232769979; Fri, 13 Oct 2023 14:32:49 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id j5-20020aa78d05000000b0068842ebfd10sm13977191pfe.160.2023.10.13.14.32.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 14:32:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 67/85] target/sparc: Move FSQRTq to decodetree Date: Fri, 13 Oct 2023 14:28:28 -0700 Message-Id: <20231013212846.165724-68-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::330; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x330.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 | 39 +++++++++++++++++++++++---------------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index d3badc6db3..31d84f0cb3 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -241,6 +241,7 @@ FABSs 10 ..... 110100 00000 0 0000 1001 ..... @r_r2 FABSd 10 ..... 110100 00000 0 0000 1010 ..... @r_r2 FSQRTs 10 ..... 110100 00000 0 0010 1001 ..... @r_r2 FSQRTd 10 ..... 110100 00000 0 0010 1010 ..... @r_r2 +FSQRTq 10 ..... 110100 00000 0 0010 1011 ..... @r_r2 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 23b287cd38..d318c8a6e3 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -71,6 +71,7 @@ #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 gen_helper_fsqrtq ({ 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 @@ -1555,18 +1556,6 @@ static void gen_fop_DDD(DisasContext *dc, int rd, int rs1, int rs2, gen_store_fpr_D(dc, rd, dst); } -static void gen_fop_QQ(DisasContext *dc, int rd, int rs, - void (*gen)(TCGv_ptr)) -{ - gen_op_load_fpr_QT1(QFPREG(rs)); - - gen(tcg_env); - gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); - - gen_op_store_QT0_fpr(QFPREG(rd)); - gen_update_fprs_dirty(dc, QFPREG(rd)); -} - #ifdef TARGET_SPARC64 static void gen_ne_fop_QQ(DisasContext *dc, int rd, int rs, void (*gen)(TCGv_ptr)) @@ -4829,6 +4818,27 @@ TRANS(FSQRTd, ALL, do_env_dd, a, gen_helper_fsqrtd) TRANS(FxTOd, 64, do_env_dd, a, gen_helper_fxtod) TRANS(FdTOx, 64, do_env_dd, a, gen_helper_fdtox) +static bool do_env_qq(DisasContext *dc, arg_r_r *a, + void (*func)(TCGv_env)) +{ + if (gen_trap_ifnofpu(dc)) { + return true; + } + if (gen_trap_float128(dc)) { + return true; + } + + gen_op_clear_ieee_excp_and_FTT(); + gen_op_load_fpr_QT1(QFPREG(a->rs)); + func(tcg_env); + gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); + gen_op_store_QT0_fpr(QFPREG(a->rd)); + gen_update_fprs_dirty(dc, QFPREG(a->rd)); + return advance_pc(dc); +} + +TRANS(FSQRTq, ALL, do_env_qq, a, gen_helper_fsqrtq) + static bool do_fff(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i32, TCGv_i32, TCGv_i32)) { @@ -4974,11 +4984,8 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x2a: /* fsqrtd */ case 0x82: /* V9 fdtox */ case 0x88: /* V9 fxtod */ - g_assert_not_reached(); /* in decodetree */ case 0x2b: /* fsqrtq */ - CHECK_FPU_FEATURE(dc, FLOAT128); - gen_fop_QQ(dc, rd, rs2, gen_helper_fsqrtq); - break; + g_assert_not_reached(); /* in decodetree */ case 0x41: /* fadds */ gen_fop_FFF(dc, rd, rs1, rs2, gen_helper_fadds); break;