From patchwork Tue Oct 17 06:12:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 734312 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp325033wro; Mon, 16 Oct 2023 23:23:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJ1iBAgrHA2oPwLq/1L3O5qGWx2kgzs0HXxIEWinw+/Y0FkmQv1SGzoiypj8vQEJbVjxj0 X-Received: by 2002:a05:622a:188a:b0:417:b975:6d8a with SMTP id v10-20020a05622a188a00b00417b9756d8amr1889604qtc.56.1697523827224; Mon, 16 Oct 2023 23:23:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697523827; cv=none; d=google.com; s=arc-20160816; b=VQX18X5UgrkVyIb4DpZG5yTN7HLPv4IpPqC5g00NLrd16AtcJddtAgjcvgKb49iJZG tuLwKuYXi7eWKQeKUBkOwk29aetGGsT38ilWaQbXCWGkh/7xz0Q0Zze6VKlA8t41a8at v35SYV0Pe+fTU5VtWoM1WTfX17yzze3hJNNNG18SYS+Ol2UQAVIuxDyv8JQVmSb75w8C Da0X4AVQ9t66V4+p2T4FgMhkN5UDuJ+LzvjwCKXUJP5QyMAIi7e1wHLQ2pdQiePgSw1s tfMLjA8P/Hs/kxKKP4fHgIlnUwZWFSUlqFmrLV4FUdAo9Fl1sjohk7lk2pjx1+72prJi 1QMw== 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=elYXAD3nwI6hLY/7KpdbyhH5H49IoHErFhX1BnONLII=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=INMDn46fZQGG/IQea/8eSKHqLfy0aBo2ZxAyFeM4OlaTrJxc/AXGaIpKsbsTBMPkKA oZbkHFe2mUG/znihmDdeS4OKUx49KbopGaoXvLhJ4XugmkVZ5ygCVWSZFHz4XjJ4Tp9r DryR5NVJsxW5HFVe4nlRju/2GQ9n2swNyzRYJshSqVoxfCmc3jJf9i56e4ER4+Te4d6G 8eajzdvk7lXwMz/jPdd2ne+aWv1s5kEWTTBA2HD172DdayJGY5kUrfLjnAjTdVrj9wn3 DVHM5GS+tm2QEOryjvvxW5UvUuqCi9Chv9Rahmkp2Of4WAebL2gVJ7vVMbVuvDzId9H2 UWvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B6hn4JVI; 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 y21-20020a05622a005500b0041981b8a9dfsi655378qtw.75.2023.10.16.23.23.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2023 23:23:47 -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=B6hn4JVI; 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 1qsdO3-00046L-62; Tue, 17 Oct 2023 02:17:03 -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 1qsdNv-0003jD-MD for qemu-devel@nongnu.org; Tue, 17 Oct 2023 02:16:55 -0400 Received: from mail-vs1-xe2c.google.com ([2607:f8b0:4864:20::e2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qsdNu-0004q9-01 for qemu-devel@nongnu.org; Tue, 17 Oct 2023 02:16:55 -0400 Received: by mail-vs1-xe2c.google.com with SMTP id ada2fe7eead31-457e5dec94dso783530137.3 for ; Mon, 16 Oct 2023 23:16:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697523413; x=1698128213; 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=elYXAD3nwI6hLY/7KpdbyhH5H49IoHErFhX1BnONLII=; b=B6hn4JVIU9zXDEsFnx3wWaK4NHJ22Bwkhlo0ZLQEzQhGbJkbFGfcgKlzhIoo/ZPg2b gbzMuexg0sd3vE1IwEZEDyKPYrEjvx1FB/YwGJp3rlQCTGyqaEf9iV9pvJmwd9omLvoh knAOziHCaywIpU2J74s41uVbTddfZfICqTrHIhJAUxIBTJncVWqKyMLuZeVDyjZGg5JD V/+jjym65lu9ewvR7f3FBM73qqZxseAC0Ohd02L00IgZOZrHzTzVZ95jKkLJ+T+Njw8O egGFK5vE7jLTqPh5Jhfa4WVgGrOeY4Vq6N7Y8ip2cWEQA9Ls1kbOimDwl1ERPbzpmeBe Ws+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697523413; x=1698128213; 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=elYXAD3nwI6hLY/7KpdbyhH5H49IoHErFhX1BnONLII=; b=WiaMxL4xSF+dE6nze2hD8FonFc9Xp0pzpSRyC05r8j24SyhSgRnuxu7CxNYvjO68F4 JsDw2A/tfgxWtoQdiVZYRPMy5F0pnHVprX09bEz3eLUo+g+rTsCOigFXPsq7Q2Xc9kDl zbg4pabKHUJ4vgt034zm2rxNHyJM4Q54+lCqe1CXXtQ87QlfT7NPdALGDO1ztTTL0pLU 5eDjYf/8K0/zbIhvGJcPRdnbJ5aBMiwIN34rKp4tRtnsxw6JlIl789Gg/xRQxo2Nyngk lzBnIFG+a68UVjsjzvy/6unBCbs4qqiiCP17bVN4LngCiSL3Infsap+zwI0BL38MTglj vOfw== X-Gm-Message-State: AOJu0YwIrmrsuVmI17LMgvMs0vep4JAaaSshOUfZz+MQm2K9EXZvDnh6 Dqo7wr6xbeILlwL6brbIyQ9cUin7xAuikmvMWHo= X-Received: by 2002:a67:c390:0:b0:458:aa1:e0d6 with SMTP id s16-20020a67c390000000b004580aa1e0d6mr1578939vsj.0.1697523412888; Mon, 16 Oct 2023 23:16:52 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id m10-20020a056a00080a00b00690ca4356f1sm579280pfk.198.2023.10.16.23.16.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 23:16:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 79/90] target/sparc: Move FiTOd, FsTOd, FsTOx to decodetree Date: Mon, 16 Oct 2023 23:12:33 -0700 Message-Id: <20231017061244.681584-80-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::e2c; envelope-from=richard.henderson@linaro.org; helo=mail-vs1-xe2c.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 a0af20f042..1965084fb8 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -255,11 +255,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 acb9e58319..395674d901 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -54,6 +54,7 @@ #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_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_fnegd(D, S) qemu_build_not_reached() @@ -1625,37 +1626,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)) { @@ -4855,6 +4825,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)) { @@ -5154,17 +5147,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); @@ -5198,9 +5188,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);