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