[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 16/69] target/arm: Convert RMIF to decodetree
From: |
Richard Henderson |
Subject: |
[PATCH v2 16/69] target/arm: Convert RMIF to decodetree |
Date: |
Tue, 10 Dec 2024 10:16:40 -0600 |
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/tcg/translate-a64.c | 32 +++++++++-----------------------
target/arm/tcg/a64.decode | 3 +++
2 files changed, 12 insertions(+), 23 deletions(-)
diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c
index d7747fcf57..1af41e22eb 100644
--- a/target/arm/tcg/translate-a64.c
+++ b/target/arm/tcg/translate-a64.c
@@ -8045,30 +8045,18 @@ TRANS(SBC, do_adc_sbc, a, true, false)
TRANS(ADCS, do_adc_sbc, a, false, true)
TRANS(SBCS, do_adc_sbc, a, true, true)
-/*
- * Rotate right into flags
- * 31 30 29 21 15 10 5 4 0
- * +--+--+--+-----------------+--------+-----------+------+--+------+
- * |sf|op| S| 1 1 0 1 0 0 0 0 | imm6 | 0 0 0 0 1 | Rn |o2| mask |
- * +--+--+--+-----------------+--------+-----------+------+--+------+
- */
-static void disas_rotate_right_into_flags(DisasContext *s, uint32_t insn)
+static bool trans_RMIF(DisasContext *s, arg_RMIF *a)
{
- int mask = extract32(insn, 0, 4);
- int o2 = extract32(insn, 4, 1);
- int rn = extract32(insn, 5, 5);
- int imm6 = extract32(insn, 15, 6);
- int sf_op_s = extract32(insn, 29, 3);
+ int mask = a->mask;
TCGv_i64 tcg_rn;
TCGv_i32 nzcv;
- if (sf_op_s != 5 || o2 != 0 || !dc_isar_feature(aa64_condm_4, s)) {
- unallocated_encoding(s);
- return;
+ if (!dc_isar_feature(aa64_condm_4, s)) {
+ return false;
}
- tcg_rn = read_cpu_reg(s, rn, 1);
- tcg_gen_rotri_i64(tcg_rn, tcg_rn, imm6);
+ tcg_rn = read_cpu_reg(s, a->rn, 1);
+ tcg_gen_rotri_i64(tcg_rn, tcg_rn, a->imm);
nzcv = tcg_temp_new_i32();
tcg_gen_extrl_i64_i32(nzcv, tcg_rn);
@@ -8086,6 +8074,7 @@ static void disas_rotate_right_into_flags(DisasContext
*s, uint32_t insn)
if (mask & 1) { /* V */
tcg_gen_shli_i32(cpu_VF, nzcv, 31 - 0);
}
+ return true;
}
/*
@@ -8297,11 +8286,6 @@ static void disas_data_proc_reg(DisasContext *s,
uint32_t insn)
switch (op2) {
case 0x0:
switch (op3) {
- case 0x01: /* Rotate right into flags */
- case 0x21:
- disas_rotate_right_into_flags(s, insn);
- break;
-
case 0x02: /* Evaluate into flags */
case 0x12:
case 0x22:
@@ -8311,6 +8295,8 @@ static void disas_data_proc_reg(DisasContext *s, uint32_t
insn)
default:
case 0x00: /* Add/subtract (with carry) */
+ case 0x01: /* Rotate right into flags */
+ case 0x21:
goto do_unallocated;
}
break;
diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode
index 7a40ca455e..454494742e 100644
--- a/target/arm/tcg/a64.decode
+++ b/target/arm/tcg/a64.decode
@@ -753,6 +753,9 @@ SBC . 10 11010000 ..... 000000 ..... .....
@rrr_sf
SBCS . 11 11010000 ..... 000000 ..... ..... @rrr_sf
# Rotate right into flags
+
+RMIF 1 01 11010000 imm:6 00001 rn:5 0 mask:4
+
# Evaluate into flags
# Conditional compare (regster)
# Conditional compare (immediate)
--
2.43.0
- [PATCH v2 14/69] target/arm: Convert disas_data_proc_3src to decodetree, (continued)
- [PATCH v2 14/69] target/arm: Convert disas_data_proc_3src to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 15/69] target/arm: Convert disas_adc_sbc to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 18/69] target/arm: Convert CCMP, CCMN to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 19/69] target/arm: Convert disas_cond_select to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 21/69] target/arm: Introduce fp_access_check_vector_hsd, Richard Henderson, 2024/12/10
- [PATCH v2 22/69] target/arm: Convert FCMP, FCMPE, FCCMP, FCCMPE to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 17/69] target/arm: Convert SETF8, SETF16 to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 23/69] target/arm: Fix decode of fp16 vector fabs, fneg, Richard Henderson, 2024/12/10
- [PATCH v2 16/69] target/arm: Convert RMIF to decodetree,
Richard Henderson <=
- [PATCH v2 20/69] target/arm: Introduce fp_access_check_scalar_hsd, Richard Henderson, 2024/12/10
- [PATCH v2 25/69] target/arm: Pass fpstatus to vfp_sqrt*, Richard Henderson, 2024/12/10
- [PATCH v2 26/69] target/arm: Remove helper_sqrt_f16, Richard Henderson, 2024/12/10
- [PATCH v2 24/69] target/arm: Convert FMOV, FABS, FNEG (scalar) to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 27/69] target/arm: Convert FSQRT (scalar) to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 28/69] target/arm: Convert FRINT[NPMSAXI] (scalar) to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 30/69] target/arm: Convert FRINT{32, 64}[ZX] (scalar) to decodetree, Richard Henderson, 2024/12/10
- [PATCH v2 29/69] target/arm: Convert BFCVT to decodetree, Richard Henderson, 2024/12/10