1 /* ------------------------------------------------------------------ */
2 /* WARNING: relative order of tokens is important. */
18 DEF_ASM(r12
) /* ip[c] */
25 DEF_ASM(fp
) /* alias for r11 */
26 DEF_ASM(ip
) /* alias for r12 */
27 DEF_ASM(sp
) /* alias for r13 */
28 DEF_ASM(lr
) /* alias for r14 */
29 DEF_ASM(pc
) /* alias for r15 */
50 /* coprocessor registers */
69 /* single-precision VFP registers */
104 /* double-precision VFP registers */
123 /* VFP status registers */
129 /* VFP magical ARM register */
133 /* data processing directives */
137 /* instructions that have no condition code */
145 #define ARM_INSTRUCTION_GROUP(tok) ((((tok) - TOK_ASM_nopeq) & 0xFFFFFFF0) + TOK_ASM_nopeq)
147 /* Note: condition code is 4 bits */
148 #define DEF_ASM_CONDED(x) \
149 DEF(TOK_ASM_ ## x ## eq, #x "eq") \
150 DEF(TOK_ASM_ ## x ## ne, #x "ne") \
151 DEF(TOK_ASM_ ## x ## cs, #x "cs") \
152 DEF(TOK_ASM_ ## x ## cc, #x "cc") \
153 DEF(TOK_ASM_ ## x ## mi, #x "mi") \
154 DEF(TOK_ASM_ ## x ## pl, #x "pl") \
155 DEF(TOK_ASM_ ## x ## vs, #x "vs") \
156 DEF(TOK_ASM_ ## x ## vc, #x "vc") \
157 DEF(TOK_ASM_ ## x ## hi, #x "hi") \
158 DEF(TOK_ASM_ ## x ## ls, #x "ls") \
159 DEF(TOK_ASM_ ## x ## ge, #x "ge") \
160 DEF(TOK_ASM_ ## x ## lt, #x "lt") \
161 DEF(TOK_ASM_ ## x ## gt, #x "gt") \
162 DEF(TOK_ASM_ ## x ## le, #x "le") \
163 DEF(TOK_ASM_ ## x, #x) \
164 DEF(TOK_ASM_ ## x ## rsvd, #x "rsvd")
166 /* Note: condition code is 4 bits */
167 #define DEF_ASM_CONDED_WITH_SUFFIX(x, y) \
168 DEF(TOK_ASM_ ## x ## eq ## _ ## y, #x "eq." #y) \
169 DEF(TOK_ASM_ ## x ## ne ## _ ## y, #x "ne." #y) \
170 DEF(TOK_ASM_ ## x ## cs ## _ ## y, #x "cs." #y) \
171 DEF(TOK_ASM_ ## x ## cc ## _ ## y, #x "cc." #y) \
172 DEF(TOK_ASM_ ## x ## mi ## _ ## y, #x "mi." #y) \
173 DEF(TOK_ASM_ ## x ## pl ## _ ## y, #x "pl." #y) \
174 DEF(TOK_ASM_ ## x ## vs ## _ ## y, #x "vs." #y) \
175 DEF(TOK_ASM_ ## x ## vc ## _ ## y, #x "vc." #y) \
176 DEF(TOK_ASM_ ## x ## hi ## _ ## y, #x "hi." #y) \
177 DEF(TOK_ASM_ ## x ## ls ## _ ## y, #x "ls." #y) \
178 DEF(TOK_ASM_ ## x ## ge ## _ ## y, #x "ge." #y) \
179 DEF(TOK_ASM_ ## x ## lt ## _ ## y, #x "lt." #y) \
180 DEF(TOK_ASM_ ## x ## gt ## _ ## y, #x "gt." #y) \
181 DEF(TOK_ASM_ ## x ## le ## _ ## y, #x "le." #y) \
182 DEF(TOK_ASM_ ## x ## _ ## y, #x "." #y) \
183 DEF(TOK_ASM_ ## x ## rsvd ## _ ## y, #x "rsvd." #y)
185 #define DEF_ASM_CONDED_VFP_F32_F64(x) \
186 DEF_ASM_CONDED_WITH_SUFFIX(x, f32) \
187 DEF_ASM_CONDED_WITH_SUFFIX(x, f64)
189 #define DEF_ASM_CONDED_WITH_TWO_SUFFIXES(x, y, z) \
190 DEF(TOK_ASM_ ## x ## eq ## _ ## y ## _ ## z, #x "eq." #y "." #z) \
191 DEF(TOK_ASM_ ## x ## ne ## _ ## y ## _ ## z, #x "ne." #y "." #z) \
192 DEF(TOK_ASM_ ## x ## cs ## _ ## y ## _ ## z, #x "cs." #y "." #z) \
193 DEF(TOK_ASM_ ## x ## cc ## _ ## y ## _ ## z, #x "cc." #y "." #z) \
194 DEF(TOK_ASM_ ## x ## mi ## _ ## y ## _ ## z, #x "mi." #y "." #z) \
195 DEF(TOK_ASM_ ## x ## pl ## _ ## y ## _ ## z, #x "pl." #y "." #z) \
196 DEF(TOK_ASM_ ## x ## vs ## _ ## y ## _ ## z, #x "vs." #y "." #z) \
197 DEF(TOK_ASM_ ## x ## vc ## _ ## y ## _ ## z, #x "vc." #y "." #z) \
198 DEF(TOK_ASM_ ## x ## hi ## _ ## y ## _ ## z, #x "hi." #y "." #z) \
199 DEF(TOK_ASM_ ## x ## ls ## _ ## y ## _ ## z, #x "ls." #y "." #z) \
200 DEF(TOK_ASM_ ## x ## ge ## _ ## y ## _ ## z, #x "ge." #y "." #z) \
201 DEF(TOK_ASM_ ## x ## lt ## _ ## y ## _ ## z, #x "lt." #y "." #z) \
202 DEF(TOK_ASM_ ## x ## gt ## _ ## y ## _ ## z, #x "gt." #y "." #z) \
203 DEF(TOK_ASM_ ## x ## le ## _ ## y ## _ ## z, #x "le." #y "." #z) \
204 DEF(TOK_ASM_ ## x ## _ ## y ## _ ## z, #x "." #y "." #z) \
205 DEF(TOK_ASM_ ## x ## rsvd ## _ ## y ## _ ## z, #x "rsvd." #y "." #z)
207 /* Note: add new tokens after nop (MUST always use DEF_ASM_CONDED) */
218 /* size conversion */
233 DEF_ASM_CONDED(smull
)
234 DEF_ASM_CONDED(smulls
)
235 DEF_ASM_CONDED(umull
)
236 DEF_ASM_CONDED(umulls
)
237 DEF_ASM_CONDED(smlal
)
238 DEF_ASM_CONDED(smlals
)
239 DEF_ASM_CONDED(umlal
)
240 DEF_ASM_CONDED(umlals
)
248 DEF_ASM_CONDED(ldrex
)
249 DEF_ASM_CONDED(ldrexb
)
250 DEF_ASM_CONDED(strex
)
251 DEF_ASM_CONDED(strexb
)
253 DEF_ASM_CONDED(ldrsh
)
254 DEF_ASM_CONDED(ldrsb
)
257 DEF_ASM_CONDED(stmda
)
258 DEF_ASM_CONDED(ldmda
)
261 DEF_ASM_CONDED(stmia
)
262 DEF_ASM_CONDED(ldmia
)
263 DEF_ASM_CONDED(stmdb
)
264 DEF_ASM_CONDED(ldmdb
)
265 DEF_ASM_CONDED(stmib
)
266 DEF_ASM_CONDED(ldmib
)
273 /* instruction macros */
285 /* data processing instructions; order is important */
304 DEF_ASM_CONDED(tsts
) // necessary here--but not useful to the user
306 DEF_ASM_CONDED(teqs
) // necessary here--but not useful to the user
308 DEF_ASM_CONDED(cmps
) // necessary here--but not useful to the user
310 DEF_ASM_CONDED(cmns
) // necessary here--but not useful to the user
335 // Floating point high-level instructions
340 DEF_ASM_CONDED_VFP_F32_F64(vmla
)
341 DEF_ASM_CONDED_VFP_F32_F64(vmls
)
342 DEF_ASM_CONDED_VFP_F32_F64(vnmls
)
343 DEF_ASM_CONDED_VFP_F32_F64(vnmla
)
344 DEF_ASM_CONDED_VFP_F32_F64(vmul
)
345 DEF_ASM_CONDED_VFP_F32_F64(vnmul
)
346 DEF_ASM_CONDED_VFP_F32_F64(vadd
)
347 DEF_ASM_CONDED_VFP_F32_F64(vsub
)
348 DEF_ASM_CONDED_VFP_F32_F64(vdiv
)
349 DEF_ASM_CONDED_VFP_F32_F64(vneg
)
350 DEF_ASM_CONDED_VFP_F32_F64(vabs
)
351 DEF_ASM_CONDED_VFP_F32_F64(vsqrt
)
352 DEF_ASM_CONDED_VFP_F32_F64(vcmp
)
353 DEF_ASM_CONDED_VFP_F32_F64(vcmpe
)
354 DEF_ASM_CONDED_VFP_F32_F64(vmov
)
356 DEF_ASM_CONDED_WITH_TWO_SUFFIXES(vcvtr
, s32
, f64
)
357 DEF_ASM_CONDED_WITH_TWO_SUFFIXES(vcvtr
, s32
, f32
)
358 DEF_ASM_CONDED_WITH_TWO_SUFFIXES(vcvtr
, u32
, f64
)
359 DEF_ASM_CONDED_WITH_TWO_SUFFIXES(vcvtr
, u32
, f32
)
361 DEF_ASM_CONDED_WITH_TWO_SUFFIXES(vcvt
, s32
, f64
)
362 DEF_ASM_CONDED_WITH_TWO_SUFFIXES(vcvt
, s32
, f32
)
363 DEF_ASM_CONDED_WITH_TWO_SUFFIXES(vcvt
, u32
, f64
)
364 DEF_ASM_CONDED_WITH_TWO_SUFFIXES(vcvt
, u32
, f32
)
366 DEF_ASM_CONDED_WITH_TWO_SUFFIXES(vcvt
, f64
, s32
)
367 DEF_ASM_CONDED_WITH_TWO_SUFFIXES(vcvt
, f32
, s32
)
368 DEF_ASM_CONDED_WITH_TWO_SUFFIXES(vcvt
, f64
, u32
)
369 DEF_ASM_CONDED_WITH_TWO_SUFFIXES(vcvt
, f32
, u32
)
371 DEF_ASM_CONDED_WITH_TWO_SUFFIXES(vcvt
, f64
, f32
)
372 DEF_ASM_CONDED_WITH_TWO_SUFFIXES(vcvt
, f32
, f64
)
374 DEF_ASM_CONDED(vpush
)
377 DEF_ASM_CONDED(vldmia
)
378 DEF_ASM_CONDED(vldmdb
)
380 DEF_ASM_CONDED(vstmia
)
381 DEF_ASM_CONDED(vstmdb
)