[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 59/85] target/arm: Convert [US]CVTF (vector, integer) scalar to de
From: |
Peter Maydell |
Subject: |
[PULL 59/85] target/arm: Convert [US]CVTF (vector, integer) scalar to decodetree |
Date: |
Fri, 13 Dec 2024 17:32:03 +0000 |
From: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20241211163036.2297116-60-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/tcg/a64.decode | 6 ++++++
target/arm/tcg/translate-a64.c | 35 ++++++++++++++++++++++++----------
2 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode
index f66f62da4f0..146500d9c4b 100644
--- a/target/arm/tcg/a64.decode
+++ b/target/arm/tcg/a64.decode
@@ -1657,6 +1657,12 @@ FCVTXN_s 0111 1110 011 00001 01101 0 ..... .....
@rr_s
@icvt_sd . ....... .. ...... ...... rn:5 rd:5 \
&fcvt sf=0 esz=%esz_sd shift=0
+SCVTF_f 0101 1110 011 11001 11011 0 ..... ..... @icvt_h
+SCVTF_f 0101 1110 0.1 00001 11011 0 ..... ..... @icvt_sd
+
+UCVTF_f 0111 1110 011 11001 11011 0 ..... ..... @icvt_h
+UCVTF_f 0111 1110 0.1 00001 11011 0 ..... ..... @icvt_sd
+
FCVTNS_f 0101 1110 011 11001 10101 0 ..... ..... @icvt_h
FCVTNS_f 0101 1110 0.1 00001 10101 0 ..... ..... @icvt_sd
FCVTNU_f 0111 1110 011 11001 10101 0 ..... ..... @icvt_h
diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c
index 894befef4dc..6e9d040ebfb 100644
--- a/target/arm/tcg/translate-a64.c
+++ b/target/arm/tcg/translate-a64.c
@@ -8599,6 +8599,29 @@ static bool do_cvtf_g(DisasContext *s, arg_fcvt *a, bool
is_signed)
TRANS(SCVTF_g, do_cvtf_g, a, true)
TRANS(UCVTF_g, do_cvtf_g, a, false)
+/*
+ * [US]CVTF (vector), scalar version.
+ * Which sounds weird, but really just means input from fp register
+ * instead of input from general register. Input and output element
+ * size are always equal.
+ */
+static bool do_cvtf_f(DisasContext *s, arg_fcvt *a, bool is_signed)
+{
+ TCGv_i64 tcg_int;
+ int check = fp_access_check_scalar_hsd(s, a->esz);
+
+ if (check <= 0) {
+ return check == 0;
+ }
+
+ tcg_int = tcg_temp_new_i64();
+ read_vec_element(s, tcg_int, a->rn, 0, a->esz | (is_signed ? MO_SIGN : 0));
+ return do_cvtf_scalar(s, a->esz, a->rd, a->shift, tcg_int, is_signed);
+}
+
+TRANS(SCVTF_f, do_cvtf_f, a, true)
+TRANS(UCVTF_f, do_cvtf_f, a, false)
+
static void do_fcvt_scalar(DisasContext *s, MemOp out, MemOp esz,
TCGv_i64 tcg_out, int shift, int rn,
ARMFPRounding rmode)
@@ -9838,16 +9861,6 @@ static void disas_simd_scalar_two_reg_misc(DisasContext
*s, uint32_t insn)
case 0x6d: /* FCMLE (zero) */
handle_2misc_fcmp_zero(s, opcode, true, u, true, size, rn, rd);
return;
- case 0x1d: /* SCVTF */
- case 0x5d: /* UCVTF */
- {
- bool is_signed = (opcode == 0x1d);
- if (!fp_access_check(s)) {
- return;
- }
- handle_simd_intfp_conv(s, rd, rn, 1, is_signed, 0, size);
- return;
- }
case 0x3d: /* FRECPE */
case 0x3f: /* FRECPX */
case 0x7d: /* FRSQRTE */
@@ -9867,6 +9880,8 @@ static void disas_simd_scalar_two_reg_misc(DisasContext
*s, uint32_t insn)
case 0x1c: /* FCVTAS */
case 0x5c: /* FCVTAU */
case 0x56: /* FCVTXN, FCVTXN2 */
+ case 0x1d: /* SCVTF */
+ case 0x5d: /* UCVTF */
default:
unallocated_encoding(s);
return;
--
2.34.1
- [PULL 25/85] target/arm: Pass fpstatus to vfp_sqrt*, (continued)
- [PULL 25/85] target/arm: Pass fpstatus to vfp_sqrt*, Peter Maydell, 2024/12/13
- [PULL 32/85] target/arm: Convert handle_fpfpcvt to decodetree, Peter Maydell, 2024/12/13
- [PULL 44/85] target/arm: Move helper_neon_addlp_{s8, s16} to neon_helper.c, Peter Maydell, 2024/12/13
- [PULL 49/85] target/arm: Convert XTN, SQXTUN, SQXTN, UQXTN to decodetree, Peter Maydell, 2024/12/13
- [PULL 48/85] target/arm: Introduce clear_vec, Peter Maydell, 2024/12/13
- [PULL 51/85] target/arm: Convert FCVTXN to decodetree, Peter Maydell, 2024/12/13
- [PULL 57/85] target/arm: Convert FCVT* (vector, integer) scalar to decodetree, Peter Maydell, 2024/12/13
- [PULL 55/85] target/arm: Convert FSQRT (vector) to decodetree, Peter Maydell, 2024/12/13
- [PULL 11/85] target/arm: Convert disas_logic_reg to decodetree, Peter Maydell, 2024/12/13
- [PULL 68/85] target/arm: Convert URECPE and URSQRTE to decodetree, Peter Maydell, 2024/12/13
- [PULL 59/85] target/arm: Convert [US]CVTF (vector, integer) scalar to decodetree,
Peter Maydell <=
- [PULL 62/85] target/arm: Convert [US]CVTF (vector) to decodetree, Peter Maydell, 2024/12/13
- [PULL 66/85] target/arm: Convert FRECPE, FRECPX, FRSQRTE to decodetree, Peter Maydell, 2024/12/13
- [PULL 75/85] MAINTAINERS: correct my email address, Peter Maydell, 2024/12/13
- [PULL 70/85] target/arm: Use float_round_to_odd in helper_fcvtx_f64_to_f32, Peter Maydell, 2024/12/13
- [PULL 80/85] target/arm: Move AArch64 EL3 TLBI insns, Peter Maydell, 2024/12/13
- [PULL 81/85] target/arm: Move TLBI range insns, Peter Maydell, 2024/12/13
- [PULL 12/85] target/arm: Convert disas_add_sub_ext_reg to decodetree, Peter Maydell, 2024/12/13
- [PULL 10/85] target/arm: Convert XPAC[ID] to decodetree, Peter Maydell, 2024/12/13
- [PULL 14/85] target/arm: Convert disas_data_proc_3src to decodetree, Peter Maydell, 2024/12/13
- [PULL 18/85] target/arm: Convert CCMP, CCMN to decodetree, Peter Maydell, 2024/12/13