[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 59/69] target/arm: Convert [US]CVTF (vector, integer) scalar t
From: |
Richard Henderson |
Subject: |
[PATCH v2 59/69] target/arm: Convert [US]CVTF (vector, integer) scalar to decodetree |
Date: |
Tue, 10 Dec 2024 10:17:23 -0600 |
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/tcg/translate-a64.c | 35 ++++++++++++++++++++++++----------
target/arm/tcg/a64.decode | 6 ++++++
2 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c
index 894befef4d..6e9d040ebf 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;
diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode
index f66f62da4f..146500d9c4 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
--
2.43.0
- [PATCH v2 52/69] target/arm: Convert SHLL to decodetree, (continued)
- [PATCH v2 52/69] target/arm: Convert SHLL to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 53/69] target/arm: Implement gen_gvec_fabs, gen_gvec_fneg, Richard Henderson, 2024/12/10
- [PATCH v2 55/69] target/arm: Convert FSQRT (vector) to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 57/69] target/arm: Convert FCVT* (vector, integer) scalar to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 58/69] target/arm: Convert FCVT* (vector, fixed-point) scalar to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 63/69] target/arm: Convert FCVTZ[SU] (vector, fixed-point) to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 59/69] target/arm: Convert [US]CVTF (vector, integer) scalar to decodetree,
Richard Henderson <=
- [PATCH v2 56/69] target/arm: Convert FRINT* (vector) to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 61/69] target/arm: Rename helper_gvec_vcvt_[hf][su] with _rz, Richard Henderson, 2024/12/10
- [PATCH v2 66/69] target/arm: Convert FRECPE, FRECPX, FRSQRTE to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 68/69] target/arm: Convert URECPE and URSQRTE to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 54/69] target/arm: Convert FABS, FNEG (vector) to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 60/69] target/arm: Convert [US]CVTF (vector, fixed-point) scalar to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 62/69] target/arm: Convert [US]CVTF (vector) to decodetree, Richard Henderson, 2024/12/10