1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#ifndef TARGET_ARM_TRANSLATE_A64_H
19#define TARGET_ARM_TRANSLATE_A64_H
20
21#define unsupported_encoding(s, insn) \
22 do { \
23 qemu_log_mask(LOG_UNIMP, \
24 "%s:%d: unsupported instruction encoding 0x%08x " \
25 "at pc=%016" PRIx64 "\n", \
26 __FILE__, __LINE__, insn, s->pc_curr); \
27 unallocated_encoding(s); \
28 } while (0)
29
30TCGv_i64 new_tmp_a64(DisasContext *s);
31TCGv_i64 new_tmp_a64_local(DisasContext *s);
32TCGv_i64 new_tmp_a64_zero(DisasContext *s);
33TCGv_i64 cpu_reg(DisasContext *s, int reg);
34TCGv_i64 cpu_reg_sp(DisasContext *s, int reg);
35TCGv_i64 read_cpu_reg(DisasContext *s, int reg, int sf);
36TCGv_i64 read_cpu_reg_sp(DisasContext *s, int reg, int sf);
37void write_fp_dreg(DisasContext *s, int reg, TCGv_i64 v);
38bool logic_imm_decode_wmask(uint64_t *result, unsigned int immn,
39 unsigned int imms, unsigned int immr);
40bool sve_access_check(DisasContext *s);
41TCGv_i64 clean_data_tbi(DisasContext *s, TCGv_i64 addr);
42TCGv_i64 gen_mte_check1(DisasContext *s, TCGv_i64 addr, bool is_write,
43 bool tag_checked, int log2_size);
44TCGv_i64 gen_mte_checkN(DisasContext *s, TCGv_i64 addr, bool is_write,
45 bool tag_checked, int size);
46
47
48
49
50
51
52
53
54static inline void assert_fp_access_checked(DisasContext *s)
55{
56#ifdef CONFIG_DEBUG_TCG
57 if (unlikely(!s->fp_access_checked || s->fp_excp_el)) {
58 fprintf(stderr, "target-arm: FP access check missing for "
59 "instruction 0x%08x\n", s->insn);
60 abort();
61 }
62#endif
63}
64
65
66
67
68
69static inline int vec_reg_offset(DisasContext *s, int regno,
70 int element, MemOp size)
71{
72 int element_size = 1 << size;
73 int offs = element * element_size;
74#ifdef HOST_WORDS_BIGENDIAN
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89 if (element_size < 8) {
90 offs ^= 8 - element_size;
91 }
92#endif
93 offs += offsetof(CPUARMState, vfp.zregs[regno]);
94 assert_fp_access_checked(s);
95 return offs;
96}
97
98
99static inline int vec_full_reg_offset(DisasContext *s, int regno)
100{
101 assert_fp_access_checked(s);
102 return offsetof(CPUARMState, vfp.zregs[regno]);
103}
104
105
106static inline TCGv_ptr vec_full_reg_ptr(DisasContext *s, int regno)
107{
108 TCGv_ptr ret = tcg_temp_new_ptr();
109 tcg_gen_addi_ptr(ret, cpu_env, vec_full_reg_offset(s, regno));
110 return ret;
111}
112
113
114static inline int vec_full_reg_size(DisasContext *s)
115{
116 return s->sve_len;
117}
118
119bool disas_sve(DisasContext *, uint32_t);
120
121void gen_gvec_rax1(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
122 uint32_t rm_ofs, uint32_t opr_sz, uint32_t max_sz);
123void gen_gvec_xar(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
124 uint32_t rm_ofs, int64_t shift,
125 uint32_t opr_sz, uint32_t max_sz);
126
127#endif
128