From patchwork Fri Oct 13 21:28:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 733292 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1679175wrv; Fri, 13 Oct 2023 14:34:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG2392uOwnHZsja158qR+eNrdxOeTbYjQt4VaMBPfujS/n9evlaTqQgNLdMa207EVGps9dX X-Received: by 2002:a05:622a:34b:b0:418:1c4d:cb77 with SMTP id r11-20020a05622a034b00b004181c4dcb77mr36585944qtw.58.1697232863604; Fri, 13 Oct 2023 14:34:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697232863; cv=none; d=google.com; s=arc-20160816; b=zs5csxfpljvah7jg8Zl10Kvkjq6Yvm10N219Dlv0Nzm97JhFMwrlMFi4+NsmXSI0I3 Ng58sJWz02sexlQ9Lwky5jD0jeOwzIc8iY04Ci2JRg+GzycFKjBjXvBda6o/CWoGCHe0 Cb0HaTmVqHri+09uSSuwSt3MFApEfkvk1+BMrAAZ3IKh2G9W9IgyIt7jyEbSCjegj3bx n5OVSnSPRyLwSGDHhipqWGG7KZgH/6bAiCd6GZsmRLcIy0bExyvAk1qXaCRIdjW0K2K4 IlooJuEHIDmMpc4u1/IbxdyKJUoUsb6LWI7nUEMU6z1MXIGc5XCOZQzxrvTsSMEqLFgL pA9Q== 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=+E6rWcA820AIhQUkQjZUIaMHfBsnT3Jt1vQDJ8CIQNA=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=bF/uQDn9B4RrUbYVTNebvYIL7fHhP+OjwZTHEwAAcs3QzDLVMN+A9uWZrwRVqxbR4a ag6oNwHhRYqkJCStUVPt2/pwp4uNet6biuf/4pYlEl+Zngin4ZTZ+HueaRy+Wxm9M6Rp 83zdocSVQLd1GxS7I2sADJkWX4zygE9JQn2/rzAZAjk0fvIAEKRoL6IbhBZQjFLBDjfA 87/Btvgl8NvCDgzk9PC6SKkVMAcvhN/dFpbt9NGxoJKA8v8q5NTS76qolgvoH94b2qiq pKwhDZPN3zqdd4go+V4EJYYGowHFPbP370OqKiHsIhJf9eP3Wo88+NrmkiQYaCm67+Q7 U7nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T2JEsdKG; 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 y13-20020a05622a004d00b004108a7e5ef6si1930481qtw.126.2023.10.13.14.34.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 14:34:23 -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=T2JEsdKG; 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 1qrPmo-0003z0-FB; Fri, 13 Oct 2023 17:33:34 -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 1qrPmF-0002Pq-Tz for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:33:00 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrPmD-0001ZK-0R for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:32:58 -0400 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6b20a48522fso1017031b3a.1 for ; Fri, 13 Oct 2023 14:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697232776; x=1697837576; 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=+E6rWcA820AIhQUkQjZUIaMHfBsnT3Jt1vQDJ8CIQNA=; b=T2JEsdKG5Og7GZhbJcyebNeNejr/F0gYCF1lZ5IcH8J17RLN82o1i7WJXZ4MPKPHQ/ CoyO0y44L7CJOmWMrLo8Dc4kZ0mSAkeny9129YeUW9KCYxKQKx4Vw5jafNyUufflBETu zOz/0YudGekGns7e5cMLZuhFQLgIHeMXQoJbY7MXe4b90VNnT+vekTrElehK6w+7bQdW fQG7awh87hQbpB6OO2f1dRJc/DF9waod8YlYbOZ0at2Z5RCsn740vPMSX927u0Uvb+iw o07WA566z92K3qzvH1NMCx30pDDy59/F+BGnIuewl0TKGBvGXBAETlDxL6bmqhe9/QH+ W2dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697232776; x=1697837576; 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=+E6rWcA820AIhQUkQjZUIaMHfBsnT3Jt1vQDJ8CIQNA=; b=XqdEhiDvG7PmDQZQ0Vjwm9Kq8XizprROSfu0CbgJhiq1S2TA/wJ4Sb1x1bWSfRg7ce D8ihkObehr2jaTW4ivHswF4ea5xOi6Q1eEuCNh+I2ElaWQwCVqojug+4OVPTSVG715w0 HMb/XFtwSZZiSt4XgUX6AkHJu3v1iK4uqlRGPkjhTcq23XyVuLNzzsW4dbMIBn63SF0Q cAqdOPvMADRlspD6nJ9BzmzJlvktuHu4hwT854lt+pNBtxu5e4f55rsQdsF1KSRInTAL syLBOMe9OhSPqkFkmceS8EOecYxY8O+95aXSAYcPDgstYckQOSsuwpeO68fQT5oAAZyj bIPA== X-Gm-Message-State: AOJu0YzalhImgKRVN0T2uQx7p9WDZRMrRNLcB10EpqtOvU/F9v+HnNbN cC10d1GISIAD++UhmsCePwq6z9tYQQXeXnD+uOI= X-Received: by 2002:a05:6a00:1388:b0:68c:a81:4368 with SMTP id t8-20020a056a00138800b0068c0a814368mr29449711pfg.6.1697232775714; Fri, 13 Oct 2023 14:32:55 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id j5-20020aa78d05000000b0068842ebfd10sm13977191pfe.160.2023.10.13.14.32.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 14:32:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 74/85] target/sparc: Move FiTOd, FsTOd, FsTOx to decodetree Date: Fri, 13 Oct 2023 14:28:35 -0700 Message-Id: <20231013212846.165724-75-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::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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 Note that gen_ne_fop_DF was incorrectly named and does pass env. The two sets of helpers should have been unified. Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 3 ++ target/sparc/translate.c | 67 ++++++++++++++++----------------------- 2 files changed, 30 insertions(+), 40 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 6378dc5d07..4368ac25a9 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -256,11 +256,14 @@ 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 FdMULq 10 ..... 110100 ..... 0 0110 1110 ..... @r_r_r +FsTOx 10 ..... 110100 00000 0 1000 0001 ..... @r_r2 FdTOx 10 ..... 110100 00000 0 1000 0010 ..... @r_r2 FxTOs 10 ..... 110100 00000 0 1000 0100 ..... @r_r2 FxTOd 10 ..... 110100 00000 0 1000 1000 ..... @r_r2 FiTOs 10 ..... 110100 00000 0 1100 0100 ..... @r_r2 FdTOs 10 ..... 110100 00000 0 1100 0110 ..... @r_r2 +FiTOd 10 ..... 110100 00000 0 1100 1000 ..... @r_r2 +FsTOd 10 ..... 110100 00000 0 1100 1001 ..... @r_r2 FsTOi 10 ..... 110100 00000 0 1101 0001 ..... @r_r2 FdTOi 10 ..... 110100 00000 0 1101 0010 ..... @r_r2 diff --git a/target/sparc/translate.c b/target/sparc/translate.c index c1a82b4c9a..1b1ac9b5f0 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -56,6 +56,7 @@ #define gen_helper_fnegd ({ qemu_build_not_reached(); NULL; }) #define gen_helper_fabsd ({ qemu_build_not_reached(); NULL; }) #define gen_helper_fdtox ({ qemu_build_not_reached(); NULL; }) +#define gen_helper_fstox ({ qemu_build_not_reached(); NULL; }) #define gen_helper_fxtod ({ qemu_build_not_reached(); NULL; }) #define gen_helper_fxtos ({ qemu_build_not_reached(); NULL; }) #define gen_helper_done(E) qemu_build_not_reached() @@ -1540,37 +1541,6 @@ static void gen_ne_fop_QQ(DisasContext *dc, int rd, int rs, } #endif -#ifdef TARGET_SPARC64 -static void gen_fop_DF(DisasContext *dc, int rd, int rs, - void (*gen)(TCGv_i64, TCGv_ptr, TCGv_i32)) -{ - TCGv_i64 dst; - TCGv_i32 src; - - src = gen_load_fpr_F(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); -} -#endif - -static void gen_ne_fop_DF(DisasContext *dc, int rd, int rs, - void (*gen)(TCGv_i64, TCGv_ptr, TCGv_i32)) -{ - TCGv_i64 dst; - TCGv_i32 src; - - src = gen_load_fpr_F(dc, rs); - dst = gen_dest_fpr_D(dc, rd); - - gen(dst, tcg_env, src); - - gen_store_fpr_D(dc, rd, dst); -} - static void gen_fop_FQ(DisasContext *dc, int rd, int rs, void (*gen)(TCGv_i32, TCGv_ptr)) { @@ -4753,6 +4723,29 @@ 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_df(DisasContext *dc, arg_r_r *a, + void (*func)(TCGv_i64, TCGv_env, TCGv_i32)) +{ + TCGv_i64 dst; + TCGv_i32 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_F(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(FiTOd, ALL, do_env_df, a, gen_helper_fitod) +TRANS(FsTOd, ALL, do_env_df, a, gen_helper_fstod) +TRANS(FsTOx, 64, do_env_df, a, gen_helper_fstox) + static bool do_env_qq(DisasContext *dc, arg_r_r *a, void (*func)(TCGv_env)) { @@ -5052,17 +5045,14 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0xc6: /* fdtos */ case 0xd2: /* fdtoi */ case 0x84: /* V9 fxtos */ + case 0xc8: /* fitod */ + case 0xc9: /* fstod */ + case 0x81: /* V9 fstox */ g_assert_not_reached(); /* in decodetree */ case 0xc7: /* fqtos */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_FQ(dc, rd, rs2, gen_helper_fqtos); break; - case 0xc8: /* fitod */ - gen_ne_fop_DF(dc, rd, rs2, gen_helper_fitod); - break; - case 0xc9: /* fstod */ - gen_ne_fop_DF(dc, rd, rs2, gen_helper_fstod); - break; case 0xcb: /* fqtod */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_DQ(dc, rd, rs2, gen_helper_fqtod); @@ -5096,9 +5086,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) CHECK_FPU_FEATURE(dc, FLOAT128); gen_ne_fop_QQ(dc, rd, rs2, gen_helper_fabsq); break; - case 0x81: /* V9 fstox */ - gen_fop_DF(dc, rd, rs2, gen_helper_fstox); - break; case 0x83: /* V9 fqtox */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_DQ(dc, rd, rs2, gen_helper_fqtox);