From patchwork Sun Oct 22 06:00:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736973 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1005984wrl; Sat, 21 Oct 2023 23:13:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHKdDwNrWDIA0Vnv46ZkSdiir9+xzXlyZ7QWnMmrsU0RjBiAcxsBrOCDtRrRt6oGIBXMcyp X-Received: by 2002:a05:6214:300f:b0:66d:630a:79b9 with SMTP id ke15-20020a056214300f00b0066d630a79b9mr6426287qvb.40.1697955199966; Sat, 21 Oct 2023 23:13:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697955199; cv=none; d=google.com; s=arc-20160816; b=hvoZAuWWb39hQCNG8iNk+LqLbFMxTK+FgTZ/HrJTa601xHlqRQdWDo9dHMlJksb1u2 nvvi4Ynx2cfkncHmWAhcmOr0p+iALi+Fs1czyOsOuc5yWzsO70fInEaMEn/1t6RaBdf7 vXCk208k73zNyVvvCr8xPr4B/nh+MeAkcngjYGyPPwiphZ6U5qyE9fizRgsNfEf9JXeS Ewt0YF7xv3FwCfhm7H/Ghxj86XeyDVhJVojd319OZ6Na2FgjJ+QAHt6z+HBYe16BhW94 0ST1KFTGXMRPp0TQkYrBE9/vcRyl9sGgpqyWQUT3m0xI46ae8vjRCJxHyifXv9r5VPaz WhVA== 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=M6g5vyScz+ALeWhTnmxU/lfyDo1xkWRNCrvwy5rwAQA=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=VYxqIwPZo4PxVatmdPx304XRFM+nFPXDLcIn4n3Bv7EmRyA8lvaCWMrZGPhiiEfbQY LmGqLhp74f75BmDJYMaKH/xj6SY3CZ36W++I2bgt9TShsojC1AXMmfpCqphiNglttzEL EOEWu+EuqpEHvN6V8AjoLuQgCAzrBL58zGItguX1YvCEOEehm3y6mPHZckmKx89avyz6 rEkkL+ovoYYMLZMxQBNAZiLxcKDpWrx3iYyidMOHQvNp8Qlu+qLldT6+uIKMiByPdQ7j /UvRkN1/5R1zf3gx+iw8euVgdsIH1fwnR9SvsfArsLUN18gCWGeyDbCRIBL/46UmpVdW dvSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jIkuXhki; 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 oh8-20020a056214438800b0065af80f546asi3996648qvb.2.2023.10.21.23.13.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 21 Oct 2023 23:13:19 -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=jIkuXhki; 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 1quRbQ-0004qL-3t; Sun, 22 Oct 2023 02:06:20 -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 1quRaD-0001eE-Dg for qemu-devel@nongnu.org; Sun, 22 Oct 2023 02:05:05 -0400 Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quRaA-0002K0-PA for qemu-devel@nongnu.org; Sun, 22 Oct 2023 02:05:04 -0400 Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-3af604c3f8fso1698286b6e.1 for ; Sat, 21 Oct 2023 23:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697954701; x=1698559501; 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=M6g5vyScz+ALeWhTnmxU/lfyDo1xkWRNCrvwy5rwAQA=; b=jIkuXhkiADGE7cj+vQhA7HH9vNc5K9LCnXL9fYMwpU5x12kUUhnhXPZyammRZI7Uz8 L2aWrsBqvacNd24FWmOZdGc5r+xtNYjLwxxpU8CskZ6iXqAiShVYbve3IwGq5+g3j7uq fhqW7FJxZuf43KZv9QbQOkwCE63S5BuhP/1ndyDJfj4ELvvkDy57NClYYnddqT841CmS ALd32KVIsE6WQ5kRqggDXnaW3Bj5wWRvWrA7YR637h6O6sprUouzlvMC8CLB3SvekUkw R4Lb7eEkxf9KDsR6JQIxBHeQqoUYGpeJCtJourwR3X2ntiQhcVmPpKACaVDag5lBU82R IwfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697954701; x=1698559501; 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=M6g5vyScz+ALeWhTnmxU/lfyDo1xkWRNCrvwy5rwAQA=; b=hgmTVb0DrSVQBICES1FXmGoPN8bxaHXN/vj2T2z7Kd9gKTnolESptx/veS5WNljexA hA996yyVGvIpKGKJy0KCYI5+y566ceb1Q2VLLxA02/WZzlp1GKu4gPIfcD5mAuGm9xF6 qa7lAuYlWE92OUaHlWbuXNrB+meygDvQgldZXVlxWmSrI25ddF/ykQ//6XfZti/p5Kbi QkWaI+XnS4HZxr+wt7qA6Y2hPG4bl00m3TR9XlkgRiA8pvokKi00i0j3hDDCDjGHOzvJ vidgASFLsIF0HVLU2xnmKSfZVEwTedDRxCNmhu/CWVpE3YbUG3Dsp0RTAkicwF7bY94z PQ7Q== X-Gm-Message-State: AOJu0YwQ2IPsPaIk5GUeGTAXbVir61S1kvJw/E67Kk3hs8kjujZgc/4T XWhg008FPhxlI+xnzFCJbhp78wco/qOYqzWoRPA= X-Received: by 2002:a05:6808:309a:b0:3b2:e5cb:8e53 with SMTP id bl26-20020a056808309a00b003b2e5cb8e53mr8653629oib.10.1697954701498; Sat, 21 Oct 2023 23:05:01 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id fb13-20020a056a002d8d00b0068a46cd4120sm4007373pfb.199.2023.10.21.23.05.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 23:05:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v4 71/90] target/sparc: Move gen_fop_DD insns to decodetree Date: Sat, 21 Oct 2023 23:00:12 -0700 Message-Id: <20231022060031.490251-72-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231022060031.490251-1-richard.henderson@linaro.org> References: <20231022060031.490251-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::232; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x232.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 FSQRTd, FxTOd, FdTOx. Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 3 +++ target/sparc/translate.c | 50 +++++++++++++++++++++------------------ 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 85464285b7..1d766fab21 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -246,6 +246,9 @@ FNEGd 10 ..... 110100 00000 0 0000 0110 ..... @r_r2 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 +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 FsTOi 10 ..... 110100 00000 0 1101 0001 ..... @r_r2 diff --git a/target/sparc/translate.c b/target/sparc/translate.c index ce5e6ef6ab..1d046151d9 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -53,6 +53,8 @@ #define gen_helper_write_softint(E, S) qemu_build_not_reached() #define gen_helper_saved ({ qemu_build_not_reached(); NULL; }) #define gen_helper_restored ({ qemu_build_not_reached(); NULL; }) +#define gen_helper_fdtox ({ qemu_build_not_reached(); NULL; }) +#define gen_helper_fxtod ({ qemu_build_not_reached(); NULL; }) #define gen_helper_fnegd(D, S) qemu_build_not_reached() #define gen_helper_fabsd(D, S) qemu_build_not_reached() #define gen_helper_done(E) qemu_build_not_reached() @@ -1665,20 +1667,6 @@ static void gen_fop_FFF(DisasContext *dc, int rd, int rs1, int rs2, gen_store_fpr_F(dc, rd, dst); } -static void gen_fop_DD(DisasContext *dc, int rd, int rs, - void (*gen)(TCGv_i64, TCGv_ptr, TCGv_i64)) -{ - TCGv_i64 dst, src; - - src = gen_load_fpr_D(dc, rs); - dst = gen_dest_fpr_D(dc, rd); - - gen(dst, tcg_env, src); - gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); - - gen_store_fpr_D(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)) { @@ -4995,6 +4983,28 @@ TRANS(FABSd, 64, do_dd, a, gen_op_fabsd) TRANS(FSRCd, VIS1, do_dd, a, tcg_gen_mov_i64) TRANS(FNOTd, VIS1, do_dd, a, tcg_gen_not_i64) +static bool do_env_dd(DisasContext *dc, arg_r_r *a, + void (*func)(TCGv_i64, TCGv_env, TCGv_i64)) +{ + TCGv_i64 dst, src; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + gen_op_clear_ieee_excp_and_FTT(); + dst = gen_dest_fpr_D(dc, a->rd); + src = gen_load_fpr_D(dc, a->rs); + func(dst, tcg_env, src); + gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); + gen_store_fpr_D(dc, a->rd, dst); + return advance_pc(dc); +} + +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_fff(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i32, TCGv_i32, TCGv_i32)) { @@ -5137,10 +5147,10 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x29: /* fsqrts */ case 0xc4: /* fitos */ case 0xd1: /* fstoi */ - g_assert_not_reached(); /* in decodetree */ case 0x2a: /* fsqrtd */ - gen_fop_DD(dc, rd, rs2, gen_helper_fsqrtd); - break; + 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); @@ -5245,9 +5255,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x81: /* V9 fstox */ gen_fop_DF(dc, rd, rs2, gen_helper_fstox); break; - case 0x82: /* V9 fdtox */ - gen_fop_DD(dc, rd, rs2, gen_helper_fdtox); - break; case 0x83: /* V9 fqtox */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_DQ(dc, rd, rs2, gen_helper_fqtox); @@ -5255,9 +5262,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x84: /* V9 fxtos */ gen_fop_FD(dc, rd, rs2, gen_helper_fxtos); break; - case 0x88: /* V9 fxtod */ - gen_fop_DD(dc, rd, rs2, gen_helper_fxtod); - break; case 0x8c: /* V9 fxtoq */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_ne_fop_QD(dc, rd, rs2, gen_helper_fxtoq);