2 * Tiny Code Generator for QEMU
4 * Copyright (c) 2008 Fabrice Bellard
5 * Copyright (c) 2008 Andrzej Zaborowski
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 #ifndef ARM_TCG_TARGET_H
27 #define ARM_TCG_TARGET_H
31 #define use_armv7_instructions (__ARM_ARCH >= 7 || arm_arch >= 7)
33 #define TCG_TARGET_INSN_UNIT_SIZE 4
34 #define MAX_CODE_GEN_BUFFER_SIZE UINT32_MAX
71 TCG_AREG0
= TCG_REG_R6
,
72 TCG_REG_CALL_STACK
= TCG_REG_R13
,
75 #define TCG_TARGET_NB_REGS 32
77 #ifdef __ARM_ARCH_EXT_IDIV__
78 #define use_idiv_instructions 1
80 extern bool use_idiv_instructions
;
83 #define use_neon_instructions 1
85 extern bool use_neon_instructions
;
88 /* used for function call generation */
89 #define TCG_TARGET_STACK_ALIGN 8
90 #define TCG_TARGET_CALL_STACK_OFFSET 0
91 #define TCG_TARGET_CALL_ARG_I32 TCG_CALL_ARG_NORMAL
92 #define TCG_TARGET_CALL_ARG_I64 TCG_CALL_ARG_EVEN
93 #define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_EVEN
94 #define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_BY_REF
96 /* optional instructions */
97 #define TCG_TARGET_HAS_ext8s_i32 1
98 #define TCG_TARGET_HAS_ext16s_i32 1
99 #define TCG_TARGET_HAS_ext8u_i32 0 /* and r0, r1, #0xff */
100 #define TCG_TARGET_HAS_ext16u_i32 1
101 #define TCG_TARGET_HAS_bswap16_i32 1
102 #define TCG_TARGET_HAS_bswap32_i32 1
103 #define TCG_TARGET_HAS_not_i32 1
104 #define TCG_TARGET_HAS_rot_i32 1
105 #define TCG_TARGET_HAS_andc_i32 1
106 #define TCG_TARGET_HAS_orc_i32 0
107 #define TCG_TARGET_HAS_eqv_i32 0
108 #define TCG_TARGET_HAS_nand_i32 0
109 #define TCG_TARGET_HAS_nor_i32 0
110 #define TCG_TARGET_HAS_clz_i32 1
111 #define TCG_TARGET_HAS_ctz_i32 use_armv7_instructions
112 #define TCG_TARGET_HAS_ctpop_i32 0
113 #define TCG_TARGET_HAS_deposit_i32 use_armv7_instructions
114 #define TCG_TARGET_HAS_extract_i32 use_armv7_instructions
115 #define TCG_TARGET_HAS_sextract_i32 use_armv7_instructions
116 #define TCG_TARGET_HAS_extract2_i32 1
117 #define TCG_TARGET_HAS_negsetcond_i32 1
118 #define TCG_TARGET_HAS_mulu2_i32 1
119 #define TCG_TARGET_HAS_muls2_i32 1
120 #define TCG_TARGET_HAS_muluh_i32 0
121 #define TCG_TARGET_HAS_mulsh_i32 0
122 #define TCG_TARGET_HAS_div_i32 use_idiv_instructions
123 #define TCG_TARGET_HAS_rem_i32 0
124 #define TCG_TARGET_HAS_qemu_st8_i32 0
126 #define TCG_TARGET_HAS_qemu_ldst_i128 0
128 #define TCG_TARGET_HAS_tst 1
130 #define TCG_TARGET_HAS_v64 use_neon_instructions
131 #define TCG_TARGET_HAS_v128 use_neon_instructions
132 #define TCG_TARGET_HAS_v256 0
134 #define TCG_TARGET_HAS_andc_vec 1
135 #define TCG_TARGET_HAS_orc_vec 1
136 #define TCG_TARGET_HAS_nand_vec 0
137 #define TCG_TARGET_HAS_nor_vec 0
138 #define TCG_TARGET_HAS_eqv_vec 0
139 #define TCG_TARGET_HAS_not_vec 1
140 #define TCG_TARGET_HAS_neg_vec 1
141 #define TCG_TARGET_HAS_abs_vec 1
142 #define TCG_TARGET_HAS_roti_vec 0
143 #define TCG_TARGET_HAS_rots_vec 0
144 #define TCG_TARGET_HAS_rotv_vec 0
145 #define TCG_TARGET_HAS_shi_vec 1
146 #define TCG_TARGET_HAS_shs_vec 0
147 #define TCG_TARGET_HAS_shv_vec 0
148 #define TCG_TARGET_HAS_mul_vec 1
149 #define TCG_TARGET_HAS_sat_vec 1
150 #define TCG_TARGET_HAS_minmax_vec 1
151 #define TCG_TARGET_HAS_bitsel_vec 1
152 #define TCG_TARGET_HAS_cmpsel_vec 0
153 #define TCG_TARGET_HAS_tst_vec 1
155 #define TCG_TARGET_DEFAULT_MO (0)
156 #define TCG_TARGET_NEED_LDST_LABELS
157 #define TCG_TARGET_NEED_POOL_LABELS