[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 33/85] target/arm: Convert FJCVTZS to decodetree
From: |
Peter Maydell |
Subject: |
[PULL 33/85] target/arm: Convert FJCVTZS to decodetree |
Date: |
Fri, 13 Dec 2024 17:31:37 +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-34-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/tcg/a64.decode | 2 ++
target/arm/tcg/translate-a64.c | 41 +++++++++++++++++-----------------
2 files changed, 22 insertions(+), 21 deletions(-)
diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode
index 5e170cec7a8..cd109616184 100644
--- a/target/arm/tcg/a64.decode
+++ b/target/arm/tcg/a64.decode
@@ -1363,6 +1363,8 @@ FCVTZU_g . 0011110 .. 111001 000000 ..... .....
@icvt
FCVTAS_g . 0011110 .. 100100 000000 ..... ..... @icvt
FCVTAU_g . 0011110 .. 100101 000000 ..... ..... @icvt
+FJCVTZS 0 0011110 01 111110 000000 ..... ..... @rr
+
# Floating-point data processing (1 source)
FMOV_s 00011110 .. 1 000000 10000 ..... ..... @rr_hsd
diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c
index 67227e26767..d260b45ddb2 100644
--- a/target/arm/tcg/translate-a64.c
+++ b/target/arm/tcg/translate-a64.c
@@ -8714,6 +8714,26 @@ TRANS(FCVTZU_g, do_fcvt_g, a, FPROUNDING_ZERO, false)
TRANS(FCVTAS_g, do_fcvt_g, a, FPROUNDING_TIEAWAY, true)
TRANS(FCVTAU_g, do_fcvt_g, a, FPROUNDING_TIEAWAY, false)
+static bool trans_FJCVTZS(DisasContext *s, arg_FJCVTZS *a)
+{
+ if (!dc_isar_feature(aa64_jscvt, s)) {
+ return false;
+ }
+ if (fp_access_check(s)) {
+ TCGv_i64 t = read_fp_dreg(s, a->rn);
+ TCGv_ptr fpstatus = fpstatus_ptr(FPST_FPCR);
+
+ gen_helper_fjcvtzs(t, t, fpstatus);
+
+ tcg_gen_ext32u_i64(cpu_reg(s, a->rd), t);
+ tcg_gen_extrh_i64_i32(cpu_ZF, t);
+ tcg_gen_movi_i32(cpu_CF, 0);
+ tcg_gen_movi_i32(cpu_NF, 0);
+ tcg_gen_movi_i32(cpu_VF, 0);
+ }
+ return true;
+}
+
static void handle_fmov(DisasContext *s, int rd, int rn, int type, bool itof)
{
/* FMOV: gpr to or from float, double, or top half of quad fp reg,
@@ -8775,20 +8795,6 @@ static void handle_fmov(DisasContext *s, int rd, int rn,
int type, bool itof)
}
}
-static void handle_fjcvtzs(DisasContext *s, int rd, int rn)
-{
- TCGv_i64 t = read_fp_dreg(s, rn);
- TCGv_ptr fpstatus = fpstatus_ptr(FPST_FPCR);
-
- gen_helper_fjcvtzs(t, t, fpstatus);
-
- tcg_gen_ext32u_i64(cpu_reg(s, rd), t);
- tcg_gen_extrh_i64_i32(cpu_ZF, t);
- tcg_gen_movi_i32(cpu_CF, 0);
- tcg_gen_movi_i32(cpu_NF, 0);
- tcg_gen_movi_i32(cpu_VF, 0);
-}
-
/* Floating point <-> integer conversions
* 31 30 29 28 24 23 22 21 20 19 18 16 15 10 9 5 4 0
* +----+---+---+-----------+------+---+-------+-----+-------------+----+----+
@@ -8843,13 +8849,6 @@ static void disas_fp_int_conv(DisasContext *s, uint32_t
insn)
break;
case 0b00111110: /* FJCVTZS */
- if (!dc_isar_feature(aa64_jscvt, s)) {
- goto do_unallocated;
- } else if (fp_access_check(s)) {
- handle_fjcvtzs(s, rd, rn);
- }
- break;
-
default:
do_unallocated:
unallocated_encoding(s);
--
2.34.1
- [PULL 15/85] target/arm: Convert disas_adc_sbc to decodetree, (continued)
- [PULL 15/85] target/arm: Convert disas_adc_sbc to decodetree, Peter Maydell, 2024/12/13
- [PULL 20/85] target/arm: Introduce fp_access_check_scalar_hsd, Peter Maydell, 2024/12/13
- [PULL 21/85] target/arm: Introduce fp_access_check_vector_hsd, Peter Maydell, 2024/12/13
- [PULL 05/85] target/arm: Convert SUBP, IRG, GMI to decodetree, Peter Maydell, 2024/12/13
- [PULL 04/85] target/arm: Convert CRC32, CRC32C to decodetree, Peter Maydell, 2024/12/13
- [PULL 03/85] target/arm: Convert LSLV, LSRV, ASRV, RORV to decodetree, Peter Maydell, 2024/12/13
- [PULL 08/85] target/arm: Convert CLZ, CLS to decodetree, Peter Maydell, 2024/12/13
- [PULL 22/85] target/arm: Convert FCMP, FCMPE, FCCMP, FCCMPE to decodetree, Peter Maydell, 2024/12/13
- [PULL 24/85] target/arm: Convert FMOV, FABS, FNEG (scalar) to decodetree, Peter Maydell, 2024/12/13
- [PULL 29/85] target/arm: Convert BFCVT to decodetree, Peter Maydell, 2024/12/13
- [PULL 33/85] target/arm: Convert FJCVTZS to decodetree,
Peter Maydell <=
- [PULL 34/85] target/arm: Convert handle_fmov to decodetree, Peter Maydell, 2024/12/13
- [PULL 36/85] target/arm: Convert ABS, NEG to decodetree, Peter Maydell, 2024/12/13
- [PULL 38/85] target/arm: Convert CLS, CLZ (vector) to decodetree, Peter Maydell, 2024/12/13
- [PULL 09/85] target/arm: Convert PAC[ID]*, AUT[ID]* to decodetree, Peter Maydell, 2024/12/13
- [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