From patchwork Tue Oct 17 06:12: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: 734315 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp325563wro; Mon, 16 Oct 2023 23:25:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpkRt7+pqwZL/wELAzRc5FTz51D4OB4+qdb9LG/H0WVTNiWgGOHCyZ+oT9qHp0O+a25Jrz X-Received: by 2002:ad4:5bab:0:b0:66d:589:5841 with SMTP id 11-20020ad45bab000000b0066d05895841mr1386545qvq.28.1697523912731; Mon, 16 Oct 2023 23:25:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697523912; cv=none; d=google.com; s=arc-20160816; b=xB4fTNyb2IOdPPliamUF3Cl4hUlL0fsrV9wCq8thXEo9vHzMmRYNU6QS4h0aicFH6d KdC5dKUqOVOtp7RDZCzPePGhGgnwJMITFXA9CHMjDxxt/XRUt6QqAczOgkiCcNQo0KG6 rmnEIF6Ruxy+mX6bOk308xBZg/iirYUyDPjINbZ+d6CVMY8pUJIMo4ld3EsT52Sx3laq gcdv7rxl4UfCl9REvLZI3GqXhYtTqQxneRvAADH6O+3pFG43g4z8pWIzeNC53Bxaj7Cl IVdNHQJsp+Z5cmEbALnaiT98dUPA0ny80QWt1TiaCQF+6d/wzXsoG9xT1VjgJe/cfNSs Fp0w== 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=W2ISP4lr5rnIMwb0yZS6PTt451/dWOxiq52Nw5r1cw8=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=M9pgAt3jJsmjs3Snmapqgm+ReZqZTn95V3wk/Z7NF4OmnQ3jtCUywhhDheErMYBGL1 ZI1C/X6FkVE2SiyJIbIwPX0D3QkbCbp/JYpEd9zteezM+S6a61Df9w0ecc/B1kuBOKDh oiNHnX4hIRZwpX6UrM3WCKhOj/nLtr5RelAcRTrP5ZUo6sQT0mO1ymalgdEABZ01bfEx cIyw7t3BwH5qvWIrggtYkJ8re47MEye3AQ0yv1i3mPp503P7MyQFAHHCk2sqStzV3lQd eEQ4Xfh15Qy7qONdyRg5Jei3R4KPkBFq5ur3EQIvW65xR7eDDyitMR26dwfUJCXoMh/+ M3Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vsE51kRQ; 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 ph28-20020a0562144a5c00b0066d09d73eadsi524518qvb.462.2023.10.16.23.25.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2023 23:25: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=vsE51kRQ; 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 1qsdNx-0003rj-6d; Tue, 17 Oct 2023 02:16: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 1qsdNt-0003aO-5W for qemu-devel@nongnu.org; Tue, 17 Oct 2023 02:16:53 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qsdNr-0004oz-Af for qemu-devel@nongnu.org; Tue, 17 Oct 2023 02:16:52 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1ca74e77aecso13871245ad.1 for ; Mon, 16 Oct 2023 23:16:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697523409; x=1698128209; 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=W2ISP4lr5rnIMwb0yZS6PTt451/dWOxiq52Nw5r1cw8=; b=vsE51kRQU/FCBPQJAn6YdyAcDrxrFPpCKCIM8JYq9LnFtV7CVcIV9Ehd9cCI6kQeZK +DcT4rb7TkU2bivYjWx5GJ+JQnfyc4vfcdf6M+CBHefDREKApGhpe3OOWE+7/s6EzNXy 0FxkdkkDcJbAkx4HoaYEa4XH4HG3vR60KVqRjYj6oZeg3cyKZh/BvB3SlDUJ7ztoyhmu IACdF8bC/3kWNZM9Thes5z8CZfKokfbczw1IeU5lg8tRX3A9srI1zU0PxTdfIbvByCQS TuEAj5WpnIcJYn0nX2Dy7PS/WYkfWTTF0pUMBDpFG1JbjGcJrjGetCOU1HM5IvblweR6 Erew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697523409; x=1698128209; 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=W2ISP4lr5rnIMwb0yZS6PTt451/dWOxiq52Nw5r1cw8=; b=CgRPAK8//Xf0Z3ZpLYsgR7AuDC+IZ29iDiQl7p25FY2+OGKqHNWZEtExD2vWI+85nO QGV7wMU+Jzv/IysATk5iO3mJ81hN/IY5O7EG4ZZRIPFNeJgTEUf8Z51sITbQJht9BbUo qa7dBDYX3sQDTIu1wHVawtR2/alDE9iiUI3LQUTvEBiW51JNTv10iQtXTjBLVUuKRg21 akTNrJvUs9RQEQX24bQsnx1XXD32V2bjcihzc50u+sJ88swkI5wVhAuASrHyh/umX4dB dcYLIhmsWgrp98fYELWa/Ff5YDUUrW+H6s+0ISUt0LVSq8X4f7twe0yXHhwyYMLJfHpO hVJQ== X-Gm-Message-State: AOJu0YwaWQKcyboc1S1syIRcPblLTpOBapSl9zXhwNEWNyISDin4DW2H WIrHvZDhf2unjgiuR//IDu2grB7NaeLIbMiHZqs= X-Received: by 2002:a17:902:e841:b0:1bd:d510:78fb with SMTP id t1-20020a170902e84100b001bdd51078fbmr1715700plg.3.1697523408951; Mon, 16 Oct 2023 23:16:48 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id m10-20020a056a00080a00b00690ca4356f1sm579280pfk.198.2023.10.16.23.16.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 23:16:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 74/90] target/sparc: Move gen_fop_DDD insns to decodetree Date: Mon, 16 Oct 2023 23:12:28 -0700 Message-Id: <20231017061244.681584-75-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231017061244.681584-1-richard.henderson@linaro.org> References: <20231017061244.681584-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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 Move FADDd, FSUBd, FMULd, FDIVd. Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 4 +++ target/sparc/translate.c | 55 ++++++++++++++++++++------------------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index d70f193883..a86c9c85f7 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -242,9 +242,13 @@ 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 FADDs 10 ..... 110100 ..... 0 0100 0001 ..... @r_r_r +FADDd 10 ..... 110100 ..... 0 0100 0010 ..... @r_r_r FSUBs 10 ..... 110100 ..... 0 0100 0101 ..... @r_r_r +FSUBd 10 ..... 110100 ..... 0 0100 0110 ..... @r_r_r FMULs 10 ..... 110100 ..... 0 0100 1001 ..... @r_r_r +FMULd 10 ..... 110100 ..... 0 0100 1010 ..... @r_r_r FDIVs 10 ..... 110100 ..... 0 0100 1101 ..... @r_r_r +FDIVd 10 ..... 110100 ..... 0 0100 1110 ..... @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 6b3b60fb22..a875ca716b 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1611,21 +1611,6 @@ static int gen_trap_ifnofpu(DisasContext *dc) return 0; } -static void gen_fop_DDD(DisasContext *dc, int rd, int rs1, int rs2, - void (*gen)(TCGv_i64, TCGv_ptr, TCGv_i64, TCGv_i64)) -{ - TCGv_i64 dst, src1, src2; - - src1 = gen_load_fpr_D(dc, rs1); - src2 = gen_load_fpr_D(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); -} - #ifdef TARGET_SPARC64 static void gen_ne_fop_QQ(DisasContext *dc, int rd, int rs, void (*gen)(TCGv_ptr)) @@ -5022,6 +5007,30 @@ TRANS(FPACK32, VIS1, do_ddd, a, gen_op_fpack32) TRANS(FALIGNDATAg, VIS1, do_ddd, a, gen_op_faligndata) TRANS(BSHUFFLE, VIS2, do_ddd, a, gen_op_bshuffle) +static bool do_env_ddd(DisasContext *dc, arg_r_r_r *a, + void (*func)(TCGv_i64, TCGv_env, TCGv_i64, TCGv_i64)) +{ + TCGv_i64 dst, src1, src2; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + gen_op_clear_ieee_excp_and_FTT(); + dst = gen_dest_fpr_D(dc, a->rd); + src1 = gen_load_fpr_D(dc, a->rs1); + src2 = gen_load_fpr_D(dc, a->rs2); + func(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); +} + +TRANS(FADDd, ALL, do_env_ddd, a, gen_helper_faddd) +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 do_dddd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i64, TCGv_i64, TCGv_i64)) { @@ -5099,31 +5108,23 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x45: /* fsubs */ case 0x49: /* fmuls */ case 0x4d: /* fdivs */ - g_assert_not_reached(); /* in decodetree */ case 0x42: /* faddd */ - gen_fop_DDD(dc, rd, rs1, rs2, gen_helper_faddd); - break; + case 0x46: /* fsubd */ + case 0x4a: /* fmuld */ + case 0x4e: /* fdivd */ + g_assert_not_reached(); /* in decodetree */ case 0x43: /* faddq */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_QQQ(dc, rd, rs1, rs2, gen_helper_faddq); break; - case 0x46: /* fsubd */ - gen_fop_DDD(dc, rd, rs1, rs2, gen_helper_fsubd); - break; case 0x47: /* fsubq */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_QQQ(dc, rd, rs1, rs2, gen_helper_fsubq); break; - case 0x4a: /* fmuld */ - gen_fop_DDD(dc, rd, rs1, rs2, gen_helper_fmuld); - break; case 0x4b: /* fmulq */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_QQQ(dc, rd, rs1, rs2, gen_helper_fmulq); break; - case 0x4e: /* fdivd */ - gen_fop_DDD(dc, rd, rs1, rs2, gen_helper_fdivd); - break; case 0x4f: /* fdivq */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_QQQ(dc, rd, rs1, rs2, gen_helper_fdivq);