[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/85] target/arm: Convert PAC[ID]*, AUT[ID]* to decodetree
From: |
Peter Maydell |
Subject: |
[PULL 09/85] target/arm: Convert PAC[ID]*, AUT[ID]* to decodetree |
Date: |
Fri, 13 Dec 2024 17:31:13 +0000 |
From: Richard Henderson <richard.henderson@linaro.org>
This includes PACIA, PACIZA, PACIB, PACIZB, PACDA, PACDZA, PACDB,
PACDZB, AUTIA, AUTIZA, AUTIB, AUTIZB, AUTDA, AUTDZA, AUTDB, AUTDZB.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20241211163036.2297116-10-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/tcg/a64.decode | 13 +++
target/arm/tcg/translate-a64.c | 173 +++++++++------------------------
2 files changed, 58 insertions(+), 128 deletions(-)
diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode
index 410eaa9333a..9083ac4ac30 100644
--- a/target/arm/tcg/a64.decode
+++ b/target/arm/tcg/a64.decode
@@ -699,6 +699,19 @@ REV64 1 10 11010110 00000 000011 ..... ..... @rr
CLZ . 10 11010110 00000 000100 ..... ..... @rr_sf
CLS . 10 11010110 00000 000101 ..... ..... @rr_sf
+&pacaut rd rn z
+@pacaut . .. ........ ..... .. z:1 ... rn:5 rd:5 &pacaut
+
+PACIA 1 10 11010110 00001 00.000 ..... ..... @pacaut
+PACIB 1 10 11010110 00001 00.001 ..... ..... @pacaut
+PACDA 1 10 11010110 00001 00.010 ..... ..... @pacaut
+PACDB 1 10 11010110 00001 00.011 ..... ..... @pacaut
+
+AUTIA 1 10 11010110 00001 00.100 ..... ..... @pacaut
+AUTIB 1 10 11010110 00001 00.101 ..... ..... @pacaut
+AUTDA 1 10 11010110 00001 00.110 ..... ..... @pacaut
+AUTDB 1 10 11010110 00001 00.111 ..... ..... @pacaut
+
# Logical (shifted reg)
# Add/subtract (shifted reg)
# Add/subtract (extended reg)
diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c
index 552b45b4e25..852545dfcc2 100644
--- a/target/arm/tcg/translate-a64.c
+++ b/target/arm/tcg/translate-a64.c
@@ -7764,6 +7764,35 @@ static void gen_cls32(TCGv_i64 tcg_rd, TCGv_i64 tcg_rn)
TRANS(CLZ, gen_rr, a->rd, a->rn, a->sf ? gen_clz64 : gen_clz32)
TRANS(CLS, gen_rr, a->rd, a->rn, a->sf ? tcg_gen_clrsb_i64 : gen_cls32)
+static bool gen_pacaut(DisasContext *s, arg_pacaut *a, NeonGenTwo64OpEnvFn fn)
+{
+ TCGv_i64 tcg_rd, tcg_rn;
+
+ if (a->z) {
+ if (a->rn != 31) {
+ return false;
+ }
+ tcg_rn = tcg_constant_i64(0);
+ } else {
+ tcg_rn = cpu_reg_sp(s, a->rn);
+ }
+ if (s->pauth_active) {
+ tcg_rd = cpu_reg(s, a->rd);
+ fn(tcg_rd, tcg_env, tcg_rd, tcg_rn);
+ }
+ return true;
+}
+
+TRANS_FEAT(PACIA, aa64_pauth, gen_pacaut, a, gen_helper_pacia)
+TRANS_FEAT(PACIB, aa64_pauth, gen_pacaut, a, gen_helper_pacib)
+TRANS_FEAT(PACDA, aa64_pauth, gen_pacaut, a, gen_helper_pacda)
+TRANS_FEAT(PACDB, aa64_pauth, gen_pacaut, a, gen_helper_pacdb)
+
+TRANS_FEAT(AUTIA, aa64_pauth, gen_pacaut, a, gen_helper_autia)
+TRANS_FEAT(AUTIB, aa64_pauth, gen_pacaut, a, gen_helper_autib)
+TRANS_FEAT(AUTDA, aa64_pauth, gen_pacaut, a, gen_helper_autda)
+TRANS_FEAT(AUTDB, aa64_pauth, gen_pacaut, a, gen_helper_autdb)
+
/* Logical (shifted register)
* 31 30 29 28 24 23 22 21 20 16 15 10 9 5 4 0
* +----+-----+-----------+-------+---+------+--------+------+------+
@@ -8373,134 +8402,6 @@ static void disas_data_proc_1src(DisasContext *s,
uint32_t insn)
#define MAP(SF, O2, O1) ((SF) | (O1 << 1) | (O2 << 7))
switch (MAP(sf, opcode2, opcode)) {
- case MAP(1, 0x01, 0x00): /* PACIA */
- if (s->pauth_active) {
- tcg_rd = cpu_reg(s, rd);
- gen_helper_pacia(tcg_rd, tcg_env, tcg_rd, cpu_reg_sp(s, rn));
- } else if (!dc_isar_feature(aa64_pauth, s)) {
- goto do_unallocated;
- }
- break;
- case MAP(1, 0x01, 0x01): /* PACIB */
- if (s->pauth_active) {
- tcg_rd = cpu_reg(s, rd);
- gen_helper_pacib(tcg_rd, tcg_env, tcg_rd, cpu_reg_sp(s, rn));
- } else if (!dc_isar_feature(aa64_pauth, s)) {
- goto do_unallocated;
- }
- break;
- case MAP(1, 0x01, 0x02): /* PACDA */
- if (s->pauth_active) {
- tcg_rd = cpu_reg(s, rd);
- gen_helper_pacda(tcg_rd, tcg_env, tcg_rd, cpu_reg_sp(s, rn));
- } else if (!dc_isar_feature(aa64_pauth, s)) {
- goto do_unallocated;
- }
- break;
- case MAP(1, 0x01, 0x03): /* PACDB */
- if (s->pauth_active) {
- tcg_rd = cpu_reg(s, rd);
- gen_helper_pacdb(tcg_rd, tcg_env, tcg_rd, cpu_reg_sp(s, rn));
- } else if (!dc_isar_feature(aa64_pauth, s)) {
- goto do_unallocated;
- }
- break;
- case MAP(1, 0x01, 0x04): /* AUTIA */
- if (s->pauth_active) {
- tcg_rd = cpu_reg(s, rd);
- gen_helper_autia(tcg_rd, tcg_env, tcg_rd, cpu_reg_sp(s, rn));
- } else if (!dc_isar_feature(aa64_pauth, s)) {
- goto do_unallocated;
- }
- break;
- case MAP(1, 0x01, 0x05): /* AUTIB */
- if (s->pauth_active) {
- tcg_rd = cpu_reg(s, rd);
- gen_helper_autib(tcg_rd, tcg_env, tcg_rd, cpu_reg_sp(s, rn));
- } else if (!dc_isar_feature(aa64_pauth, s)) {
- goto do_unallocated;
- }
- break;
- case MAP(1, 0x01, 0x06): /* AUTDA */
- if (s->pauth_active) {
- tcg_rd = cpu_reg(s, rd);
- gen_helper_autda(tcg_rd, tcg_env, tcg_rd, cpu_reg_sp(s, rn));
- } else if (!dc_isar_feature(aa64_pauth, s)) {
- goto do_unallocated;
- }
- break;
- case MAP(1, 0x01, 0x07): /* AUTDB */
- if (s->pauth_active) {
- tcg_rd = cpu_reg(s, rd);
- gen_helper_autdb(tcg_rd, tcg_env, tcg_rd, cpu_reg_sp(s, rn));
- } else if (!dc_isar_feature(aa64_pauth, s)) {
- goto do_unallocated;
- }
- break;
- case MAP(1, 0x01, 0x08): /* PACIZA */
- if (!dc_isar_feature(aa64_pauth, s) || rn != 31) {
- goto do_unallocated;
- } else if (s->pauth_active) {
- tcg_rd = cpu_reg(s, rd);
- gen_helper_pacia(tcg_rd, tcg_env, tcg_rd, tcg_constant_i64(0));
- }
- break;
- case MAP(1, 0x01, 0x09): /* PACIZB */
- if (!dc_isar_feature(aa64_pauth, s) || rn != 31) {
- goto do_unallocated;
- } else if (s->pauth_active) {
- tcg_rd = cpu_reg(s, rd);
- gen_helper_pacib(tcg_rd, tcg_env, tcg_rd, tcg_constant_i64(0));
- }
- break;
- case MAP(1, 0x01, 0x0a): /* PACDZA */
- if (!dc_isar_feature(aa64_pauth, s) || rn != 31) {
- goto do_unallocated;
- } else if (s->pauth_active) {
- tcg_rd = cpu_reg(s, rd);
- gen_helper_pacda(tcg_rd, tcg_env, tcg_rd, tcg_constant_i64(0));
- }
- break;
- case MAP(1, 0x01, 0x0b): /* PACDZB */
- if (!dc_isar_feature(aa64_pauth, s) || rn != 31) {
- goto do_unallocated;
- } else if (s->pauth_active) {
- tcg_rd = cpu_reg(s, rd);
- gen_helper_pacdb(tcg_rd, tcg_env, tcg_rd, tcg_constant_i64(0));
- }
- break;
- case MAP(1, 0x01, 0x0c): /* AUTIZA */
- if (!dc_isar_feature(aa64_pauth, s) || rn != 31) {
- goto do_unallocated;
- } else if (s->pauth_active) {
- tcg_rd = cpu_reg(s, rd);
- gen_helper_autia(tcg_rd, tcg_env, tcg_rd, tcg_constant_i64(0));
- }
- break;
- case MAP(1, 0x01, 0x0d): /* AUTIZB */
- if (!dc_isar_feature(aa64_pauth, s) || rn != 31) {
- goto do_unallocated;
- } else if (s->pauth_active) {
- tcg_rd = cpu_reg(s, rd);
- gen_helper_autib(tcg_rd, tcg_env, tcg_rd, tcg_constant_i64(0));
- }
- break;
- case MAP(1, 0x01, 0x0e): /* AUTDZA */
- if (!dc_isar_feature(aa64_pauth, s) || rn != 31) {
- goto do_unallocated;
- } else if (s->pauth_active) {
- tcg_rd = cpu_reg(s, rd);
- gen_helper_autda(tcg_rd, tcg_env, tcg_rd, tcg_constant_i64(0));
- }
- break;
- case MAP(1, 0x01, 0x0f): /* AUTDZB */
- if (!dc_isar_feature(aa64_pauth, s) || rn != 31) {
- goto do_unallocated;
- } else if (s->pauth_active) {
- tcg_rd = cpu_reg(s, rd);
- gen_helper_autdb(tcg_rd, tcg_env, tcg_rd, tcg_constant_i64(0));
- }
- break;
case MAP(1, 0x01, 0x10): /* XPACI */
if (!dc_isar_feature(aa64_pauth, s) || rn != 31) {
goto do_unallocated;
@@ -8530,6 +8431,22 @@ static void disas_data_proc_1src(DisasContext *s,
uint32_t insn)
case MAP(1, 0x00, 0x04):
case MAP(0, 0x00, 0x05): /* CLS */
case MAP(1, 0x00, 0x05):
+ case MAP(1, 0x01, 0x00): /* PACIA */
+ case MAP(1, 0x01, 0x01): /* PACIB */
+ case MAP(1, 0x01, 0x02): /* PACDA */
+ case MAP(1, 0x01, 0x03): /* PACDB */
+ case MAP(1, 0x01, 0x04): /* AUTIA */
+ case MAP(1, 0x01, 0x05): /* AUTIB */
+ case MAP(1, 0x01, 0x06): /* AUTDA */
+ case MAP(1, 0x01, 0x07): /* AUTDB */
+ case MAP(1, 0x01, 0x08): /* PACIZA */
+ case MAP(1, 0x01, 0x09): /* PACIZB */
+ case MAP(1, 0x01, 0x0a): /* PACDZA */
+ case MAP(1, 0x01, 0x0b): /* PACDZB */
+ case MAP(1, 0x01, 0x0c): /* AUTIZA */
+ case MAP(1, 0x01, 0x0d): /* AUTIZB */
+ case MAP(1, 0x01, 0x0e): /* AUTDZA */
+ case MAP(1, 0x01, 0x0f): /* AUTDZB */
unallocated_encoding(s);
break;
}
--
2.34.1
- [PULL 04/85] target/arm: Convert CRC32, CRC32C to decodetree, (continued)
- [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, 2024/12/13
- [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 <=
- [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