From patchwork Fri Oct 13 21:28:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 733288 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1679049wrv; Fri, 13 Oct 2023 14:33:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvioSkhrj0qQhNFwKWjbpIxd64y5FR691fruWP8C/u3q1CNGXOgQ0IIYaDFFma7JM8EItG X-Received: by 2002:a25:bcc5:0:b0:d9b:351:63bb with SMTP id l5-20020a25bcc5000000b00d9b035163bbmr2853347ybm.52.1697232835646; Fri, 13 Oct 2023 14:33:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697232835; cv=none; d=google.com; s=arc-20160816; b=ulNbMOqp7LlSC9Fvpc+R5PkzxslziYDL8u1gUlfmt6ODu7pEQB4+dymce1f2wTsOlG xwr/k5ZqGbCN0I2viRSFjSwH+jYUum8nBUv3AN06Mves9FBPN6LVsHYuatJCd340/hCT o97uwq3MJfALCxEPrc2SCuYim8TNL1yJy7Lw9GakzFBwk3NLy0VSXSK8iekGgREcDalR 0dzRNXVAFk9j15KLKx6mPA0cdBMgfU4J7JN5dE3dyDmR3oryQQbmr0R3kagYRK060PLU 1VtIXW/e6Ik9RUnWdnCQJAnykbnAVorLWfacAA/V6GP5mCzlcGCUw1zDCM/vzmqKgZ9x TPRg== 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=1fUFReiGGrSAsXHAPvg4XHxZdv3lDyewTKjnxe4wPUw=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=mClNV1ZxFHIVimcmxx2AXbDasQCxCmBkKdKKHvtg1A7nLCT9unp1wVPp55PEmetE+h TSRE+qzqSJ+LnAA5BBU7xi87OBLHSyaThWiBE4ilRIjHkcJB0/rHvF2xpp3RoLrlJMBd fKw0VubTUfn3PEaXXAEE/NYe6UIZxsYEzwBDZYFt1sEFat6JONMNKVrtH0CrrXpJjhwo KJrFt6Ul9S/LPNsUBtoz1RlrRHL+RkIOLRRHSklH0nJLln2Jjfch884bkpgB03dj2D7g IzxpEBw9gd+3VOVYoJTwFL3w4KXNk14mTAKxOawH6BEZYNZITUQeEwXzBPgMgF0K21rZ 3fGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="R/kz08jO"; 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 o8-20020a0cecc8000000b0064f4589991esi1796710qvq.320.2023.10.13.14.33.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 14:33:55 -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="R/kz08jO"; 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 1qrPmB-0001x7-Uv; 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 1qrPmA-0001hL-3b for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:32:54 -0400 Received: from mail-oo1-xc2f.google.com ([2607:f8b0:4864:20::c2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrPm8-0001Y2-4b for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:32:53 -0400 Received: by mail-oo1-xc2f.google.com with SMTP id 006d021491bc7-57bab4e9e1aso1461348eaf.3 for ; Fri, 13 Oct 2023 14:32:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697232771; x=1697837571; 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=1fUFReiGGrSAsXHAPvg4XHxZdv3lDyewTKjnxe4wPUw=; b=R/kz08jOpD96OjS/CnKenirfsxCwxzFe6pvhxbp3qGeWyOboQEdpOI4tgyC/n5aO37 YzhCGeWldSQVxkWsd27N2DE6shPCEoCir91W0A6xN1LJkrpDHt6cFMpS3BdPMoNtPxdg 3qSrmfhN8Sarx691sljCSLyfFslnL2QO7FrZGLM8MCKzsQ4eC+BPJl6H6qKJMsnSJyHE ebbzjgz6H+aN/elfV3L/CnCkUkwi1tCl9q+bOhbuh0gdFjkktKGHxGBUdV9Teodg7TRL 9AMzgvSJV0gtnz0M+4PHzrX2eZUOJrPUA4Pzufedk+B7c7Mr4SusWnUR3UlbeGRCehAP AEoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697232771; x=1697837571; 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=1fUFReiGGrSAsXHAPvg4XHxZdv3lDyewTKjnxe4wPUw=; b=jC5HomO6yWc+momIJt7xir4Rnes07NPhW1g+xrwMLiZzs8zWMSuxEhwrgZb4CpYwke zD8qGNDVn5Z9A6ggBwmP5uYwpCweoLjm43lTCRikENsAam73LkNoy0xO7wpS2JlplcBo hmvZF9hM5wk76PrLFeepoMlLgexj9kMBlYy6TZKxOkdcD2JDBQT8UXvPxLsccjKb2yS9 au2rmm+yBk/tg6qSKIaZOMeairUNm6821bLtRCeVvYmAyvhrxL635zBC5BYhtvRhzChf 2oRM3mkCeo5i7Z/RnNRt4RZKr0E4KetcyPn2mwopKDWFreCgvB8it0VuE5t2lYE/flRz wQpg== X-Gm-Message-State: AOJu0YxesuRSAffQYZF2Fc7irBf7Hu+Fo9AJyKcCz35FK/HOrEfx5ArG osHtD6tWyMEC0/MqbzX1uxXBH8nKFe+tYpivKyI= X-Received: by 2002:a05:6358:290b:b0:134:ded4:294 with SMTP id y11-20020a056358290b00b00134ded40294mr33625483rwb.17.1697232770818; Fri, 13 Oct 2023 14:32:50 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id j5-20020aa78d05000000b0068842ebfd10sm13977191pfe.160.2023.10.13.14.32.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 14:32:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 68/85] target/sparc: Move gen_fop_FFF insns to decodetree Date: Fri, 13 Oct 2023 14:28:29 -0700 Message-Id: <20231013212846.165724-69-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::c2f; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2f.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 FADDs, FSUBs, FMULs, FDIVs. Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 4 +++ target/sparc/translate.c | 54 +++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 31d84f0cb3..fcf4704ef8 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -242,6 +242,10 @@ 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 +FADDs 10 ..... 110100 ..... 0 0100 0001 ..... @r_r_r +FSUBs 10 ..... 110100 ..... 0 0100 0101 ..... @r_r_r +FMULs 10 ..... 110100 ..... 0 0100 1001 ..... @r_r_r +FDIVs 10 ..... 110100 ..... 0 0100 1101 ..... @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 d318c8a6e3..9d68c8cc20 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1526,21 +1526,6 @@ static void gen_op_clear_ieee_excp_and_FTT(void) tcg_gen_andi_tl(cpu_fsr, cpu_fsr, FSR_FTT_CEXC_NMASK); } -static void gen_fop_FFF(DisasContext *dc, int rd, int rs1, int rs2, - void (*gen)(TCGv_i32, TCGv_ptr, TCGv_i32, TCGv_i32)) -{ - TCGv_i32 dst, src1, src2; - - src1 = gen_load_fpr_F(dc, rs1); - src2 = gen_load_fpr_F(dc, rs2); - dst = gen_dest_fpr_F(dc); - - gen(dst, tcg_env, src1, src2); - gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); - - gen_store_fpr_F(dc, rd, dst); -} - static void gen_fop_DDD(DisasContext *dc, int rd, int rs1, int rs2, void (*gen)(TCGv_i64, TCGv_ptr, TCGv_i64, TCGv_i64)) { @@ -4868,6 +4853,29 @@ TRANS(FXNORs, VIS1, do_fff, a, tcg_gen_eqv_i32) TRANS(FORNOTs, VIS1, do_fff, a, tcg_gen_orc_i32) TRANS(FORs, VIS1, do_fff, a, tcg_gen_or_i32) +static bool do_env_fff(DisasContext *dc, arg_r_r_r *a, + void (*func)(TCGv_i32, TCGv_env, TCGv_i32, TCGv_i32)) +{ + TCGv_i32 src1, src2; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + gen_op_clear_ieee_excp_and_FTT(); + src1 = gen_load_fpr_F(dc, a->rs1); + src2 = gen_load_fpr_F(dc, a->rs2); + func(src1, tcg_env, src1, src2); + gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); + gen_store_fpr_F(dc, a->rd, src1); + return advance_pc(dc); +} + +TRANS(FADDs, ALL, do_env_fff, a, gen_helper_fadds) +TRANS(FSUBs, ALL, do_env_fff, a, gen_helper_fsubs) +TRANS(FMULs, ALL, do_env_fff, a, gen_helper_fmuls) +TRANS(FDIVs, ALL, do_env_fff, a, gen_helper_fdivs) + static bool do_ddd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i64, TCGv_i64)) { @@ -4985,10 +4993,11 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x82: /* V9 fdtox */ case 0x88: /* V9 fxtod */ case 0x2b: /* fsqrtq */ - g_assert_not_reached(); /* in decodetree */ case 0x41: /* fadds */ - gen_fop_FFF(dc, rd, rs1, rs2, gen_helper_fadds); - break; + 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; @@ -4996,9 +5005,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_QQQ(dc, rd, rs1, rs2, gen_helper_faddq); break; - case 0x45: /* fsubs */ - gen_fop_FFF(dc, rd, rs1, rs2, gen_helper_fsubs); - break; case 0x46: /* fsubd */ gen_fop_DDD(dc, rd, rs1, rs2, gen_helper_fsubd); break; @@ -5006,9 +5012,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_QQQ(dc, rd, rs1, rs2, gen_helper_fsubq); break; - case 0x49: /* fmuls */ - gen_fop_FFF(dc, rd, rs1, rs2, gen_helper_fmuls); - break; case 0x4a: /* fmuld */ gen_fop_DDD(dc, rd, rs1, rs2, gen_helper_fmuld); break; @@ -5016,9 +5019,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_QQQ(dc, rd, rs1, rs2, gen_helper_fmulq); break; - case 0x4d: /* fdivs */ - gen_fop_FFF(dc, rd, rs1, rs2, gen_helper_fdivs); - break; case 0x4e: /* fdivd */ gen_fop_DDD(dc, rd, rs1, rs2, gen_helper_fdivd); break;