blob: 98768b5d6a1761a678421fa4b090a877be48696a [file] [log] [blame]
</
@ RUN: llvm-mc -triple=thumbv7-apple-darwin -mcpu=cortex-a8 -show-encoding < %s | FileCheck %s
@ RUN: llvm-mc -triple=thumbebv7-unknown-unknown -mcpu=cortex-a8 -show-encoding < %s | FileCheck --check-prefix=CHECK-BE %s
.syntax unified
.globl _func
@ Check that the assembler can handle the documented syntax from the ARM ARM.
@ For complex constructs like shifter operands, check more thoroughly for them
@ once then spot check that following instructions accept the form generally.
@ This gives us good coverage while keeping the overall size of the test
@ more reasonable.
@ FIXME: Some 3-operand instructions have a 2-operand assembly syntax.
_func:
@ CHECK: _func
@------------------------------------------------------------------------------
@ ADC (immediate)
@------------------------------------------------------------------------------
adc r0, r1, #4
adcs r0, r1, #0
adc r1, r2, #255
adc r3, r7, #0x00550055
adc r8, r12, #0xaa00aa00
adc r9, r7, #0xa5a5a5a5
adc r5, r3, #0x87000000
adc r4, r2, #0x7f800000
adc r4, r2, #0x00000680
adc r0, #1
adc r1, #0x7f800000
@ CHECK: adc r0, r1, #4 @ encoding: [0x41,0xf1,0x04,0x00]
@ CHECK: adcs r0, r1, #0 @ encoding: [0x51,0xf1,0x00,0x00]
@ CHECK: adc r1, r2, #255 @ encoding: [0x42,0xf1,0xff,0x01]
@ CHECK: adc r3, r7, #5570645 @ encoding: [0x47,0xf1,0x55,0x13]
@ CHECK: adc r8, r12, #2852170240 @ encoding: [0x4c,0xf1,0xaa,0x28]
@ CHECK: adc r9, r7, #2779096485 @ encoding: [0x47,0xf1,0xa5,0x39]
@ CHECK: adc r5, r3, #2264924160 @ encoding: [0x43,0xf1,0x07,0x45]
@ CHECK: adc r4, r2, #2139095040 @ encoding: [0x42,0xf1,0xff,0x44]
@ CHECK: adc r4, r2, #1664 @ encoding: [0x42,0xf5,0xd0,0x64]
@ CHECK: adc r0, r0, #1 @ encoding: [0x40,0xf1,0x01,0x00]
@ CHECK: adc r1, r1, #2139095040 @ encoding: [0x41,0xf1,0xff,0x41]
@------------------------------------------------------------------------------
@ ADC (register)
@------------------------------------------------------------------------------
adc r4, r5, r6
adcs r4, r5, r6
adc.w r9, r1, r3
adcs.w r9, r1, r3
adc r0, r1, r3, ror #4
adcs r0, r1, r3, lsl #7
adc.w r0, r1, r3, lsr #31
adcs.w r0, r1, r3, asr #32
adc r4, r5
adc.w r9, r1
adc r0, r1, ror #4
adc.w r0, r1, lsr #31
@ CHECK: adc.w r4, r5, r6 @ encoding: [0x45,0xeb,0x06,0x04]
@ CHECK: adcs.w r4, r5, r6 @ encoding: [0x55,0xeb,0x06,0x04]
@ CHECK: adc.w r9, r1, r3 @ encoding: [0x41,0xeb,0x03,0x09]
@ CHECK: adcs.w r9, r1, r3 @ encoding: [0x51,0xeb,0x03,0x09]
@ CHECK: adc.w r0, r1, r3, ror #4 @ encoding: [0x41,0xeb,0x33,0x10]
@ CHECK: adcs.w r0, r1, r3, lsl #7 @ encoding: [0x51,0xeb,0xc3,0x10]
@ CHECK: adc.w r0, r1, r3, lsr #31 @ encoding: [0x41,0xeb,0xd3,0x70]
@ CHECK: adcs.w r0, r1, r3, asr #32 @ encoding: [0x51,0xeb,0x23,0x00]
@ CHECK: adc.w r4, r4, r5 @ encoding: [0x44,0xeb,0x05,0x04]
@ CHECK: adc.w r9, r9, r1 @ encoding: [0x49,0xeb,0x01,0x09]
@ CHECK: adc.w r0, r0, r1, ror #4 @ encoding: [0x40,0xeb,0x31,0x10]
@ CHECK: adc.w r0, r0, r1, lsr #31 @ encoding: [0x40,0xeb,0xd1,0x70]
@------------------------------------------------------------------------------
@ ADD (immediate)
@------------------------------------------------------------------------------
itet eq
addeq r1, r2, #4
addwne r5, r3, #1023
addeq r4, r5, #293
add r2, sp, #1024
add r2, r8, #0xff00
add r2, r3, #257
addw r2, r3, #257
add r12, r6, #0x100
addw r12, r6, #0x100
adds r1, r2, #0x1f0
add r2, #1
add r0, r0, #32
adds r2, r2, #56
adds r2, #56
add r1, r7, #0xcbcbcbcb
adds.w r2, #-16
adds.w r2, r2, #-16
addw r2, #-16
addw r2, #-16
addw r2, r2, #-16
@ CHECK: itet eq @ encoding: [0x0a,0xbf]
@ CHECK: addeq r1, r2, #4 @ encoding: [0x11,0x1d]
@ CHECK: addwne r5, r3, #1023 @ encoding: [0x03,0xf2,0xff,0x35]
@ CHECK: addweq r4, r5, #293 @ encoding: [0x05,0xf2,0x25,0x14]
@ CHECK: add.w r2, sp, #1024 @ encoding: [0x0d,0xf5,0x80,0x62]
@ CHECK: add.w r2, r8, #65280 @ encoding: [0x08,0xf5,0x7f,0x42]
@ CHECK: addw r2, r3, #257 @ encoding: [0x03,0xf2,0x01,0x12]
@ CHECK: addw r2, r3, #257 @ encoding: [0x03,0xf2,0x01,0x12]
@ CHECK: add.w r12, r6, #256 @ encoding: [0x06,0xf5,0x80,0x7c]
@ CHECK: addw r12, r6, #256 @ encoding: [0x06,0xf2,0x00,0x1c]
@ CHECK: adds.w r1, r2, #496 @ encoding: [0x12,0xf5,0xf8,0x71]
@ CHECK: add.w r2, r2, #1 @ encoding: [0x02,0xf1,0x01,0x02]
@ CHECK: add.w r0, r0, #32 @ encoding: [0x00,0xf1,0x20,0x00]
@ CHECK: adds r2, #56 @ encoding: [0x38,0x32]
@ CHECK: adds r2, #56 @ encoding: [0x38,0x32]
@ CHECK: add.w r1, r7, #3419130827 @ encoding: [0x07,0xf1,0xcb,0x31]
@ CHECK: subs.w r2, r2, #16 @ encoding: [0xb2,0xf1,0x10,0x02]
@ CHECK: subs.w r2, r2, #16 @ encoding: [0xb2,0xf1,0x10,0x02]
@ CHECK: subw r2, r2, #16 @ encoding: [0xa2,0xf2,0x10,0x02]
@ CHECK: subw r2, r2, #16 @ encoding: [0xa2,0xf2,0x10,0x02]
@ CHECK: subw r2, r2, #16 @ encoding: [0xa2,0xf2,0x10,0x02]
@------------------------------------------------------------------------------
@ ADD (register, not SP) A8.8.6
@------------------------------------------------------------------------------
add r1, r2, r8
add r5, r9, r2, asr #32
adds r7, r3, r1, lsl #31
adds.w r0, r3, r6, lsr #25
add.w r4, r8, r1, ror #12
adds r1, r1, r7 // T1
it eq
addeq r1, r3, r5 // T1
it eq
addeq r1, r1, r5 // T1
it eq
addseq r1, r3, r5 // T3
it eq
addseq r1, r1, r5 // T3
add r10, r8
add r10, r10, r8
it eq
addeq r1, r10 // T2
it eq
addseq r1, r10 // T3
@ CHECK: add.w r1, r2, r8 @ encoding: [0x02,0xeb,0x08,0x01]
@ CHECK: add.w r5, r9, r2, asr #32 @ encoding: [0x09,0xeb,0x22,0x05]
@ CHECK: adds.w r7, r3, r1, lsl #31 @ encoding: [0x13,0xeb,0xc1,0x77]
@ CHECK: adds.w r0, r3, r6, lsr #25 @ encoding: [0x13,0xeb,0x56,0x60]
@ CHECK: add.w r4, r8, r1, ror #12 @ encoding: [0x08,0xeb,0x31,0x34]
@ CHECK: adds r1, r1, r7 @ encoding: [0xc9,0x19]
@ CHECK: it eq @ encoding: [0x08,0xbf]
@ CHECK: addeq r1, r3, r5 @ encoding: [0x59,0x19]
@ CHECK: it eq @ encoding: [0x08,0xbf]
@ CHECK: addeq r1, r1, r5 @ encoding: [0x49,0x19]
@ CHECK: it eq @ encoding: [0x08,0xbf]
@ CHECK: addseq.w r1, r3, r5 @ encoding: [0x13,0xeb,0x05,0x01]
@ CHECK: it eq @ encoding: [0x08,0xbf]
@ CHECK: addseq.w r1, r1, r5 @ encoding: [0x11,0xeb,0x05,0x01]
@ CHECK: add r10, r8 @ encoding: [0xc2,0x44]
@ CHECK: add r10, r8 @ encoding: [0xc2,0x44]
@ CHECK: it eq @ encoding: [0x08,0xbf]
@ CHECK: addeq r1, r10 @ encoding: [0x51,0x44]
@ CHECK: it eq @ encoding: [0x08,0xbf]
@ CHECK: addseq.w r1, r1, r10 @ encoding: [0x11,0xeb,0x0a,0x01]
@------------------------------------------------------------------------------
@ ADD (SP plus immediate) A8.8.9
@------------------------------------------------------------------------------
it eq
@ CHECK: it eq @ encoding: [0x08,0xbf]
addeq r7, sp, #1020 // T1
@ CHECK: addeq r7, sp, #1020 @ encoding: [0xff,0xaf]
it eq
@ CHECK: it eq @ encoding: [0x08,0xbf]
addeq sp, sp, #508 // T2
@ FIXME: ARMARM says 'addeq sp, sp, #508'
@ CHECK: addeq sp, #508 @ encoding: [0x7f,0xb0]
add r7, sp, #15 // T3
@ CHECK: add.w r7, sp, #15 @ encoding: [0x0d,0xf1,0x0f,0x07]
adds r7, sp, #16 // T3
@ CHECK: adds.w r7, sp, #16 @ encoding: [0x1d,0xf1,0x10,0x07]
add r8, sp, #16 // T3
@ CHECK: add.w r8, sp, #16 @ encoding: [0x0d,0xf1,0x10,0x08]
addw r6, sp, #1020 // T4
@ CHECK: addw r6, sp, #1020 @ encoding: [0x0d,0xf2,0xfc,0x36]
add r6, sp, #1019 // T4
@ CHECK: addw r6, sp, #1019 @ encoding: [0x0d,0xf2,0xfb,0x36]
addw r0, r0, #4095
addw r0, #4095
add r0, r0, #4095
add r0, #4095
@ CHECK-NEXT: addw r0, r0, #4095 @ encoding: [0x00,0xf6,0xff,0x70]
@ CHECK-NEXT: addw r0, r0, #4095 @ encoding: [0x00,0xf6,0xff,0x70]
@ CHECK-NEXT: addw r0, r0, #4095 @ encoding: [0x00,0xf6,0xff,0x70]
@ CHECK-NEXT: addw r0, r0, #4095 @ encoding: [0x00,0xf6,0xff,0x70]
add.w r0, r0, #-4096
add r0, r0, #-4096
add.w r0, #-4096
add r0, #-4096
@ CHECK-NEXT: sub.w r0, r0, #4096 @ encoding: [0xa0,0xf5,0x80,0x50]
@ CHECK-NEXT: sub.w r0, r0, #4096 @ encoding: [0xa0,0xf5,0x80,0x50]
@ CHECK-NEXT: sub.w r0, r0, #4096 @ encoding: [0xa0,0xf5,0x80,0x50]
@ CHECK-NEXT: sub.w r0, r0, #4096 @ encoding: [0xa0,0xf5,0x80,0x50]
adds.w r0, r0, #-4096
adds r0, r0, #-4096
adds.w r0, #-4096
adds r0, #-4096
@ CHECK-NEXT: subs.w r0, r0, #4096 @ encoding: [0xb0,0xf5,0x80,0x50]
@ CHECK-NEXT: subs.w r0, r0, #4096 @ encoding: [0xb0,0xf5,0x80,0x50]
@ CHECK-NEXT: subs.w r0, r0, #4096 @ encoding: [0xb0,0xf5,0x80,0x50]
@ CHECK-NEXT: subs.w r0, r0, #4096 @ encoding: [0xb0,0xf5,0x80,0x50]
@------------------------------------------------------------------------------
@ ADD (SP plus immediate, writing to SP)
@------------------------------------------------------------------------------
add.w sp, sp, #0x1fe0000 //T3
add.w sp, #0x1fe0000
add sp, sp, #0x1fe0000
add sp, #0x1fe0000
@ CHECK-NEXT: add.w sp, sp, #33423360 @ encoding: [0x0d,0xf1,0xff,0x7d]
@ CHECK-NEXT: add.w sp, sp, #33423360 @ encoding: [0x0d,0xf1,0xff,0x7d]
@ CHECK-NEXT: add.w sp, sp, #33423360 @ encoding: [0x0d,0xf1,0xff,0x7d]
@ CHECK-NEXT: add.w sp, sp, #33423360 @ encoding: [0x0d,0xf1,0xff,0x7d]
adds.w sp, sp, #0x1fe0000 //T3
adds.w sp, #0x1fe0000
adds sp, sp, #0x1fe0000
adds sp, #0x1fe0000
@ CHECK-NEXT: adds.w sp, sp, #33423360 @ encoding: [0x1d,0xf1,0xff,0x7d]
@ CHECK-NEXT: adds.w sp, sp, #33423360 @ encoding: [0x1d,0xf1,0xff,0x7d]
@ CHECK-NEXT: adds.w sp, sp, #33423360 @ encoding: [0x1d,0xf1,0xff,0x7d]
@ CHECK-NEXT: adds.w sp, sp, #33423360 @ encoding: [0x1d,0xf1,0xff,0x7d]
addw sp, sp, #4095 //T4
add sp, sp, #4095
addw sp, #4095
add sp, #4095
@ CHECK-NEXT: addw sp, sp, #4095 @ encoding: [0x0d,0xf6,0xff,0x7d]
@ CHECK-NEXT: addw sp, sp, #4095 @ encoding: [0x0d,0xf6,0xff,0x7d]
@ CHECK-NEXT: addw sp, sp, #4095 @ encoding: [0x0d,0xf6,0xff,0x7d]
@ CHECK-NEXT: addw sp, sp, #4095 @ encoding: [0x0d,0xf6,0xff,0x7d]
add sp, sp, #128 //T2
add sp, #128
@ CHECK-NEXT: add sp, #128 @ encoding: [0x20,0xb0]
@ CHECK-NEXT: add sp, #128 @ encoding: [0x20,0xb0]
adds sp, sp, #128 //T3
adds sp, #128
@ CHECK-NEXT: adds.w sp, sp, #128 @ encoding: [0x1d,0xf1,0x80,0x0d]
@ CHECK-NEXT: adds.w sp, sp, #128 @ encoding: [0x1d,0xf1,0x80,0x0d]
add r0, sp, #128 //T1
@ CHECK-NEXT: add r0, sp, #128 @ encoding: [0x20,0xa8]
adds r0, sp, #128 //T3
@ CHECK-NEXT: adds.w r0, sp, #128 @ encoding: [0x1d,0xf1,0x80,0x00]
addw r0, sp, #128
@ CHECK-NEXT: addw r0, sp, #128 @ encoding: [0x0d,0xf2,0x80,0x00]
@------------------------------------------------------------------------------
@ ADD (SP plus negative immediate, writing to SP)
@------------------------------------------------------------------------------
add sp, sp, #-508
add sp, #-508
@ CHECK-NEXT: sub sp, #508 @ encoding: [0xff,0xb0]
@ CHECK-NEXT: sub sp, #508 @ encoding: [0xff,0xb0]
addw sp, sp, #-4095
add sp, sp, #-4095
addw sp, #-4095
add sp, #-4095
@ CHECK-NEXT: subw sp, sp, #4095 @ encoding: [0xad,0xf6,0xff,0x7d]
@ CHECK-NEXT: subw sp, sp, #4095 @ encoding: [0xad,0xf6,0xff,0x7d]
@ CHECK-NEXT: subw sp, sp, #4095 @ encoding: [0xad,0xf6,0xff,0x7d]
@ CHECK-NEXT: subw sp, sp, #4095 @ encoding: [0xad,0xf6,0xff,0x7d]
add.w sp, sp, #-4096
add sp, sp, #-4096
add.w sp, #-4096
add sp, #-4096
@ CHECK-NEXT: sub.w sp, sp, #4096 @ encoding: [0xad,0xf5,0x80,0x5d]
@ CHECK-NEXT: sub.w sp, sp, #4096 @ encoding: [0xad,0xf5,0x80,0x5d]
@ CHECK-NEXT: sub.w sp, sp, #4096 @ encoding: [0xad,0xf5,0x80,0x5d]
@ CHECK-NEXT: sub.w sp, sp, #4096 @ encoding: [0xad,0xf5,0x80,0x5d]
adds.w sp, sp, #-4096
adds sp, sp, #-4096
adds.w sp, #-4096
adds sp, #-4096
@ CHECK-NEXT: subs.w sp, sp, #4096 @ encoding: [0xbd,0xf5,0x80,0x5d]
@ CHECK-NEXT: subs.w sp, sp, #4096 @ encoding: [0xbd,0xf5,0x80,0x5d]
@ CHECK-NEXT: subs.w sp, sp, #4096 @ encoding: [0xbd,0xf5,0x80,0x5d]
@ CHECK-NEXT: subs.w sp, sp, #4096 @ encoding: [0xbd,0xf5,0x80,0x5d]
@------------------------------------------------------------------------------
@ ADD (SP plus register) A8.8.10
@------------------------------------------------------------------------------
it eq
@ CHECK: it eq @ encoding: [0x08,0xbf]
addeq r8, sp, r8 // T1
@ CHECK: addeq r8, sp, r8 @ encoding: [0xe8,0x44]
it eq
@ CHECK: it eq @ encoding: [0x08,0xbf]
addeq r8, sp // T1
@ CHECK: addeq r8, sp @ encoding: [0xe8,0x44]
it eq
@ CHECK: it eq @ encoding: [0x08,0xbf]
addeq sp, r9 // T2
@ CHECK: addeq sp, r9 @ encoding: [0xcd,0x44]
add r2, sp, ip // T3
@ CHECK: add.w r2, sp, r12 @ encoding: [0x0d,0xeb,0x0c,0x02]
it eq
@ CHECK: it eq @ encoding: [0x08,0xbf]
addeq r2, sp, ip // T3
@ CHECK: addeq.w r2, sp, r12 @ encoding: [0x0d,0xeb,0x0c,0x02]
add.w r0, sp, r0, ror #2
add r0, sp, r0, ror #2
add sp, r1, lsl #15
adds.w r0, sp, r0, ror #2
adds r0, sp, r0, ror #2
adds.w sp, sp, r0, ror #31
adds sp, sp, r0, ror #31
adds sp, r0, ror #31
@ CHECK-NEXT: add.w r0, sp, r0, ror #2 @ encoding: [0x0d,0xeb,0xb0,0x00]
@ CHECK-NEXT: add.w r0, sp, r0, ror #2 @ encoding: [0x0d,0xeb,0xb0,0x00]
@ CHECK-NEXT: add.w sp, sp, r1, lsl #15 @ encoding: [0x0d,0xeb,0xc1,0x3d]
@ CHECK-NEXT: adds.w r0, sp, r0, ror #2 @ encoding: [0x1d,0xeb,0xb0,0x00]
@ CHECK-NEXT: adds.w r0, sp, r0, ror #2 @ encoding: [0x1d,0xeb,0xb0,0x00]
@ CHECK-NEXT: adds.w sp, sp, r0, ror #31 @ encoding: [0x1d,0xeb,0xf0,0x7d]
@ CHECK-NEXT: adds.w sp, sp, r0, ror #31 @ encoding: [0x1d,0xeb,0xf0,0x7d]
@ CHECK-NEXT: adds.w sp, sp, r0, ror #31 @ encoding: [0x1d,0xeb,0xf0,0x7d]
@------------------------------------------------------------------------------
@ FIXME: ADR
@------------------------------------------------------------------------------
subw r11, pc, #3270
adr.w r2, #3
adr.w r11, #-826
adr.w r1, #-0x0
@ CHECK: subw r11, pc, #3270 @ encoding: [0xaf,0xf6,0xc6,0x4b]
@ CHECK: adr.w r2, #3 @ encoding: [0x0f,0xf2,0x03,0x02]
@ CHECK: adr.w r11, #-826 @ encoding: [0xaf,0xf2,0x3a,0x3b]
@ CHECK: adr.w r1, #-0 @ encoding: [0xaf,0xf2,0x00,0x01]
@------------------------------------------------------------------------------
@ AND (immediate)
@------------------------------------------------------------------------------
and r2, r5, #0xff000
ands r3, r12, #0xf
and r1, #0xff
and r1, r1, #0xff
and r5, r4, #0xffffffff
ands r1, r9, #0xffffffff
@ CHECK: and r2, r5, #1044480 @ encoding: [0x05,0xf4,0x7f,0x22]
@ CHECK: ands r3, r12, #15 @ encoding: [0x1c,0xf0,0x0f,0x03]
@ CHECK: and r1, r1, #255 @ encoding: [0x01,0xf0,0xff,0x01]
@ CHECK: and r1, r1, #255 @ encoding: [0x01,0xf0,0xff,0x01]
@ CHECK: and r5, r4, #4294967295 @ encoding: [0x04,0xf0,0xff,0x35]
@ CHECK: ands r1, r9, #4294967295 @ encoding: [0x19,0xf0,0xff,0x31]
@------------------------------------------------------------------------------
@ AND (register)
@------------------------------------------------------------------------------
and r4, r9, r8
and r1, r4, r8, asr #3
ands r2, r1, r7, lsl #1
ands.w r4, r5, r2, lsr #20
and.w r9, r12, r1, ror #17
@ CHECK: and.w r4, r9, r8 @ encoding: [0x09,0xea,0x08,0x04]
@ CHECK: and.w r1, r4, r8, asr #3 @ encoding: [0x04,0xea,0xe8,0x01]
@ CHECK: ands.w r2, r1, r7, lsl #1 @ encoding: [0x11,0xea,0x47,0x02]
@ CHECK: ands.w r4, r5, r2, lsr #20 @ encoding: [0x15,0xea,0x12,0x54]
@ CHECK: and.w r9, r12, r1, ror #17 @ encoding: [0x0c,0xea,0x71,0x49]
@------------------------------------------------------------------------------
@ ASR (immediate)
@------------------------------------------------------------------------------
asr r2, r3, #12
asrs r8, r3, #32
asrs.w r2, r3, #1
asr r2, r3, #4
asrs r2, r12, #15
asr r3, #19
asrs r8, #2
asrs.w r7, #5
asr.w r12, #21
asrs r1, r2, #1
itt eq
asrseq r1, r2, #1
asreq r1, r2, #1
@ CHECK: asr.w r2, r3, #12 @ encoding: [0x4f,0xea,0x23,0x32]
@ CHECK: asrs.w r8, r3, #32 @ encoding: [0x5f,0xea,0x23,0x08]
@ CHECK: asrs.w r2, r3, #1 @ encoding: [0x5f,0xea,0x63,0x02]
@ CHECK: asr.w r2, r3, #4 @ encoding: [0x4f,0xea,0x23,0x12]
@ CHECK: asrs.w r2, r12, #15 @ encoding: [0x5f,0xea,0xec,0x32]
@ CHECK: asr.w r3, r3, #19 @ encoding: [0x4f,0xea,0xe3,0x43]
@ CHECK: asrs.w r8, r8, #2 @ encoding: [0x5f,0xea,0xa8,0x08]
@ CHECK: asrs.w r7, r7, #5 @ encoding: [0x5f,0xea,0x67,0x17]
@ CHECK: asr.w r12, r12, #21 @ encoding: [0x4f,0xea,0x6c,0x5c]
@ CHECK: asrs r1, r2, #1 @ encoding: [0x51,0x10]
@ CHECK: itt eq @ encoding: [0x04,0xbf]
@ CHECK: asrseq.w r1, r2, #1 @ encoding: [0x5f,0xea,0x62,0x01]
@ CHECK: asreq r1, r2, #1 @ encoding: [0x51,0x10]
@------------------------------------------------------------------------------
@ ASR (register)
@------------------------------------------------------------------------------
asr r3, r4, r2
asr.w r1, r2
asrs r3, r4, r8
@ CHECK: asr.w r3, r4, r2 @ encoding: [0x44,0xfa,0x02,0xf3]
@ CHECK: asr.w r1, r1, r2 @ encoding: [0x41,0xfa,0x02,0xf1]
@ CHECK: asrs.w r3, r4, r8 @ encoding: [0x54,0xfa,0x08,0xf3]
@------------------------------------------------------------------------------
@ B
@------------------------------------------------------------------------------
b.w _bar
beq.w _bar
it eq
beq.w _bar
bmi.w #-183396
@ CHECK: b.w _bar @ encoding: [A,0xf0'A',A,0x90'A']
@ CHECK: @ fixup A - offset: 0, value: _bar, kind: fixup_t2_uncondbranch
@ CHECK-BE: b.w _bar @ encoding: [0xf0'A',A,0x90'A',A]
@ CHECK-BE: @ fixup A - offset: 0, value: _bar, kind: fixup_t2_uncondbranch
@ CHECK: beq.w _bar @ encoding: [A,0xf0'A',A,0x80'A']
@ CHECK: @ fixup A - offset: 0, value: _bar, kind: fixup_t2_condbranch
@ CHECK-BE: beq.w _bar @ encoding: [0xf0'A',A,0x80'A',A]
@ CHECK-BE: @ fixup A - offset: 0, value: _bar, kind: fixup_t2_condbranch
@ CHECK: it eq @ encoding: [0x08,0xbf]
@ CHECK: beq.w _bar @ encoding: [A,0xf0'A',A,0x90'A']
@ CHECK: @ fixup A - offset: 0, value: _bar, kind: fixup_t2_uncondbranch
@ CHECK-BE: beq.w _bar @ encoding: [0xf0'A',A,0x90'A',A]
@ CHECK-BE: @ fixup A - offset: 0, value: _bar, kind: fixup_t2_uncondbranch
@ CHECK: bmi.w #-183396 @ encoding: [0x13,0xf5,0xce,0xa9]
@------------------------------------------------------------------------------
@ BFC
@------------------------------------------------------------------------------
bfc r5, #3, #17
it lo
bfccc r5, #3, #17
@ CHECK: bfc r5, #3, #17 @ encoding: [0x6f,0xf3,0xd3,0x05]
@ CHECK: it lo @ encoding: [0x38,0xbf]
@ CHECK: bfclo r5, #3, #17 @ encoding: [0x6f,0xf3,0xd3,0x05]
@------------------------------------------------------------------------------
@ BFI
@------------------------------------------------------------------------------
bfi r5, r2, #3, #17
it ne
bfine r5, r2, #3, #17
@ CHECK: bfi r5, r2, #3, #17 @ encoding: [0x62,0xf3,0xd3,0x05]
@ CHECK: it ne @ encoding: [0x18,0xbf]
@ CHECK: bfine r5, r2, #3, #17 @ encoding: [0x62,0xf3,0xd3,0x05]
@------------------------------------------------------------------------------
@ BIC
@------------------------------------------------------------------------------
bic r10, r1, #0xf
bic r5, r2, #0xffffffff
bics r11, r10, #0xffffffff
bic r12, r3, r6
bic r11, r2, r6, lsl #12
bic r8, r4, r1, lsr #11
bic r7, r5, r7, lsr #15
bic r6, r7, r9, asr #32
bic r5, r6, r8, ror #1
@ destination register is optional
bic r1, #0xf
bic r1, r1
bic r4, r2, lsl #31
bic r6, r3, lsr #12
bic r7, r4, lsr #7
bic r8, r5, asr #15
bic r12, r6, ror #29
@ CHECK: bic r10, r1, #15 @ encoding: [0x21,0xf0,0x0f,0x0a]
@ CHECK: bic r5, r2, #4294967295 @ encoding: [0x22,0xf0,0xff,0x35]
@ CHECK: bics r11, r10, #4294967295 @ encoding: [0x3a,0xf0,0xff,0x3b]
@ CHECK: bic.w r12, r3, r6 @ encoding: [0x23,0xea,0x06,0x0c]
@ CHECK: bic.w r11, r2, r6, lsl #12 @ encoding: [0x22,0xea,0x06,0x3b]
@ CHECK: bic.w r8, r4, r1, lsr #11 @ encoding: [0x24,0xea,0xd1,0x28]
@ CHECK: bic.w r7, r5, r7, lsr #15 @ encoding: [0x25,0xea,0xd7,0x37]
@ CHECK: bic.w r6, r7, r9, asr #32 @ encoding: [0x27,0xea,0x29,0x06]
@ CHECK: bic.w r5, r6, r8, ror #1 @ encoding: [0x26,0xea,0x78,0x05]
@ CHECK: bic r1, r1, #15 @ encoding: [0x21,0xf0,0x0f,0x01]
@ CHECK: bic.w r1, r1, r1 @ encoding: [0x21,0xea,0x01,0x01]
@ CHECK: bic.w r4, r4, r2, lsl #31 @ encoding: [0x24,0xea,0xc2,0x74]
@ CHECK: bic.w r6, r6, r3, lsr #12 @ encoding: [0x26,0xea,0x13,0x36]
@ CHECK: bic.w r7, r7, r4, lsr #7 @ encoding: [0x27,0xea,0xd4,0x17]
@ CHECK: bic.w r8, r8, r5, asr #15 @ encoding: [0x28,0xea,0xe5,0x38]
@ CHECK: bic.w r12, r12, r6, ror #29 @ encoding: [0x2c,0xea,0x76,0x7c]
@------------------------------------------------------------------------------
@ BKPT
@------------------------------------------------------------------------------
it pl
bkpt #234
@ CHECK: it pl @ encoding: [0x58,0xbf]
@ CHECK: bkpt #234 @ encoding: [0xea,0xbe]
@------------------------------------------------------------------------------
@ BXJ
@------------------------------------------------------------------------------
bxj r5
it ne
bxjne r7
@ CHECK: bxj r5 @ encoding: [0xc5,0xf3,0x00,0x8f]
@ CHECK: it ne @ encoding: [0x18,0xbf]
@ CHECK: bxjne r7 @ encoding: [0xc7,0xf3,0x00,0x8f]
@------------------------------------------------------------------------------
@ CBZ/CBNZ
@------------------------------------------------------------------------------
cbnz r7, #6
cbnz r7, #12
cbz r6, _bar
cbnz r6, _bar
@ CHECK: cbnz r7, #6 @ encoding: [0x1f,0xb9]
@ CHECK: cbnz r7, #12 @ encoding: [0x37,0xb9]
@ CHECK: cbz r6, _bar @ encoding: [0x06'A',0xb1'A']
@ CHECK: @ fixup A - offset: 0, value: _bar, kind: fixup_arm_thumb_cb
@ CHECK-BE: cbz r6, _bar @ encoding: [0xb1'A',0x06'A']
@ CHECK-BE: @ fixup A - offset: 0, value: _bar, kind: fixup_arm_thumb_cb
@ CHECK: cbnz r6, _bar @ encoding: [0x06'A',0xb9'A']
@ CHECK: @ fixup A - offset: 0, value: _bar, kind: fixup_arm_thumb_cb
@ CHECK-BE: cbnz r6, _bar @ encoding: [0xb9'A',0x06'A']
@ CHECK-BE: @ fixup A - offset: 0, value: _bar, kind: fixup_arm_thumb_cb
@------------------------------------------------------------------------------
@ CDP/CDP2
@------------------------------------------------------------------------------
cdp p7, #1, c1, c1, c1, #4
cdp2 p7, #1, c1, c1, c1, #4
@ CHECK: cdp p7, #1, c1, c1, c1, #4 @ encoding: [0x11,0xee,0x81,0x17]
@ CHECK: cdp2 p7, #1, c1, c1, c1, #4 @ encoding: [0x11,0xfe,0x81,0x17]
@------------------------------------------------------------------------------
@ CLREX
@------------------------------------------------------------------------------
clrex
it ne
clrexne
@ CHECK: clrex @ encoding: [0xbf,0xf3,0x2f,0x8f]
@ CHECK: it ne @ encoding: [0x18,0xbf]
@ CHECK: clrexne @ encoding: [0xbf,0xf3,0x2f,0x8f]
@------------------------------------------------------------------------------
@ CLZ
@------------------------------------------------------------------------------
clz r1, r2
it eq
clzeq r1, r2
@ CHECK: clz r1, r2 @ encoding: [0xb2,0xfa,0x82,0xf1]
@ CHECK: it eq @ encoding: [0x08,0xbf]
@ CHECK: clzeq r1, r2 @ encoding: [0xb2,0xfa,0x82,0xf1]
@------------------------------------------------------------------------------
@ CMN
@------------------------------------------------------------------------------
cmn r1, #0xf
cmn r8, r6
cmn r1, r6, lsl #10
cmn r1, r6, lsr #10
cmn sp, r6, lsr #10
cmn r1, r6, asr #10
cmn r1, r6, ror #10
@ CHECK: cmn.w r1, #15 @ encoding: [0x11,0xf1,0x0f,0x0f]
@ CHECK: cmn.w r8, r6 @ encoding: [0x18,0xeb,0x06,0x0f]
@ CHECK: cmn.w r1, r6, lsl #10 @ encoding: [0x11,0xeb,0x86,0x2f]
@ CHECK: cmn.w r1, r6, lsr #10 @ encoding: [0x11,0xeb,0x96,0x2f]
@ CHECK: cmn.w sp, r6, lsr #10 @ encoding: [0x1d,0xeb,0x96,0x2f]
@ CHECK: cmn.w r1, r6, asr #10 @ encoding: [0x11,0xeb,0xa6,0x2f]
@ CHECK: cmn.w r1, r6, ror #10 @ encoding: [0x11,0xeb,0xb6,0x2f]
@------------------------------------------------------------------------------
@ CMP
@------------------------------------------------------------------------------
cmp r5, #0xff00
cmp.w r4, r12
cmp r9, r6, lsl #12
cmp r3, r7, lsr #31
cmp sp, r6, lsr #1
cmp r2, r5, asr #24
cmp r1, r4, ror #15
cmp r2, #-2
cmp r9, #1
@ CHECK: cmp.w r5, #65280 @ encoding: [0xb5,0xf5,0x7f,0x4f]
@ CHECK: cmp.w r4, r12 @ encoding: [0xb4,0xeb,0x0c,0x0f]
@ CHECK: cmp.w r9, r6, lsl #12 @ encoding: [0xb9,0xeb,0x06,0x3f]
@ CHECK: cmp.w r3, r7, lsr #31 @ encoding: [0xb3,0xeb,0xd7,0x7f]
@ CHECK: cmp.w sp, r6, lsr #1 @ encoding: [0xbd,0xeb,0x56,0x0f]
@ CHECK: cmp.w r2, r5, asr #24 @ encoding: [0xb2,0xeb,0x25,0x6f]
@ CHECK: cmp.w r1, r4, ror #15 @ encoding: [0xb1,0xeb,0xf4,0x3f]
@ CHECK: cmn.w r2, #2 @ encoding: [0x12,0xf1,0x02,0x0f]
@ CHECK: cmp.w r9, #1 @ encoding: [0xb9,0xf1,0x01,0x0f]
@------------------------------------------------------------------------------
@ CPS
@------------------------------------------------------------------------------
cpsie f
cpsid a
cpsie.w f
cpsid.w a
cpsie i, #3
cpsie.w i, #3
cpsid f, #9
cpsid.w f, #9
cps #0
cps.w #0
@ CHECK: cpsie f @ encoding: [0x61,0xb6]
@ CHECK: cpsid a @ encoding: [0x74,0xb6]
@ CHECK: cpsie.w f @ encoding: [0xaf,0xf3,0x20,0x84]
@ CHECK: cpsid.w a @ encoding: [0xaf,0xf3,0x80,0x86]
@ CHECK: cpsie i, #3 @ encoding: [0xaf,0xf3,0x43,0x85]
@ CHECK: cpsie i, #3 @ encoding: [0xaf,0xf3,0x43,0x85]
@ CHECK: cpsid f, #9 @ encoding: [0xaf,0xf3,0x29,0x87]
@ CHECK: cpsid f, #9 @ encoding: [0xaf,0xf3,0x29,0x87]
@ CHECK: cps #0 @ encoding: [0xaf,0xf3,0x00,0x81]
@ CHECK: cps #0 @ encoding: [0xaf,0xf3,0x00,0x81]
@------------------------------------------------------------------------------
@ DBG
@------------------------------------------------------------------------------
dbg #5
dbg #0
dbg #15
dbg.w #0
it ne
dbgne.w #0
@ CHECK: dbg #5 @ encoding: [0xaf,0xf3,0xf5,0x80]
@ CHECK: dbg #0 @ encoding: [0xaf,0xf3,0xf0,0x80]
@ CHECK: dbg #15 @ encoding: [0xaf,0xf3,0xff,0x80]
@ CHECK: dbg #0 @ encoding: [0xaf,0xf3,0xf0,0x80]
@ CHECK: it ne @ encoding: [0x18,0xbf]
@ CHECK: dbgne #0 @ encoding: [0xaf,0xf3,0xf0,0x80]
@------------------------------------------------------------------------------
@ DMB
@------------------------------------------------------------------------------
dmb #0xf
dmb #0xe
dmb #0xd
dmb #0xc
dmb #0xb
dmb #0xa
dmb #0x9
dmb #0x8
dmb #0x7
dmb #0x6
dmb #0x5
dmb #0x4
dmb #0x3
dmb #0x2
dmb #0x1
dmb #0x0
dmb sy
dmb.w sy
dmb st
dmb sh
dmb ish
dmb shst
dmb ishst
dmb un
dmb nsh
dmb unst
dmb nshst
dmb osh
dmb oshst
dmb
dmb.w
@ CHECK: dmb sy @ encoding: [0xbf,0xf3,0x5f,0x8f]
@ CHECK: dmb st @ encoding: [0xbf,0xf3,0x5e,0x8f]
@ CHECK: dmb #0xd @ encoding: [0xbf,0xf3,0x5d,0x8f]
@ CHECK: dmb #0xc @ encoding: [0xbf,0xf3,0x5c,0x8f]
@ CHECK: dmb ish @ encoding: [0xbf,0xf3,0x5b,0x8f]
@ CHECK: dmb ishst @ encoding: [0xbf,0xf3,0x5a,0x8f]
@ CHECK: dmb #0x9 @ encoding: [0xbf,0xf3,0x59,0x8f]
@ CHECK: dmb #0x8 @ encoding: [0xbf,0xf3,0x58,0x8f]
@ CHECK: dmb nsh @ encoding: [0xbf,0xf3,0x57,0x8f]
@ CHECK: dmb nshst @ encoding: [0xbf,0xf3,0x56,0x8f]
@ CHECK: dmb #0x5 @ encoding: [0xbf,0xf3,0x55,0x8f]
@ CHECK: dmb #0x4 @ encoding: [0xbf,0xf3,0x54,0x8f]
@ CHECK: dmb osh @ encoding: [0xbf,0xf3,0x53,0x8f]
@ CHECK: dmb oshst @ encoding: [0xbf,0xf3,0x52,0x8f]
@ CHECK: dmb #0x1 @ encoding: [0xbf,0xf3,0x51,0x8f]
@ CHECK: dmb #0x0 @ encoding: [0xbf,0xf3,0x50,0x8f]
@ CHECK: dmb sy @ encoding: [0xbf,0xf3,0x5f,0x8f]
@ CHECK: dmb sy @ encoding: [0xbf,0xf3,0x5f,0x8f]
@ CHECK: dmb st @ encoding: [0xbf,0xf3,0x5e,0x8f]
@ CHECK: dmb ish @ encoding: [0xbf,0xf3,0x5b,0x8f]
@ CHECK: dmb ish @ encoding: [0xbf,0xf3,0x5b,0x8f]
@ CHECK: dmb ishst @ encoding: [0xbf,0xf3,0x5a,0x8f]
@ CHECK: dmb ishst @ encoding: [0xbf,0xf3,0x5a,0x8f]
@ CHECK: dmb nsh @ encoding: [0xbf,0xf3,0x57,0x8f]
@ CHECK: dmb nsh @ encoding: [0xbf,0xf3,0x57,0x8f]
@ CHECK: dmb nshst @ encoding: [0xbf,0xf3,0x56,0x8f]
@ CHECK: dmb nshst @ encoding: [0xbf,0xf3,0x56,0x8f]
@ CHECK: dmb osh @ encoding: [0xbf,0xf3,0x53,0x8f]
@ CHECK: dmb oshst @ encoding: [0xbf,0xf3,0x52,0x8f]
@ CHECK: dmb sy @ encoding: [0xbf,0xf3,0x5f,0x8f]
@ CHECK: dmb sy @ encoding: [0xbf,0xf3,0x5f,0x8f]
@------------------------------------------------------------------------------
@ DSB
@------------------------------------------------------------------------------
dsb #0xf
dsb #0xe
dsb #0xd
dsb #0xc
dsb #0xb
dsb #0xa
dsb #0x9
dsb #0x8
dsb #0x7
dsb #0x6
dsb #0x5
dsb #0x4
dsb #0x3
dsb #0x2
dsb #0x1
dsb #0x0
dsb sy
dsb.w sy
dsb st
dsb sh
dsb ish
dsb shst
dsb ishst
dsb un
dsb nsh
dsb unst
dsb nshst
dsb osh
dsb oshst
dsb
dsb.w
@ CHECK: dsb sy @ encoding: [0xbf,0xf3,0x4f,0x8f]
@ CHECK: dsb st @ encoding: [0xbf,0xf3,0x4e,0x8f]
@ CHECK: dsb #0xd @ encoding: [0xbf,0xf3,0x4d,0x8f]
@ CHECK: dsb #0xc @ encoding: [0xbf,0xf3,0x4c,0x8f]
@ CHECK: dsb ish @ encoding: [0xbf,0xf3,0x4b,0x8f]
@ CHECK: dsb ishst @ encoding: [0xbf,0xf3,0x4a,0x8f]
@ CHECK: dsb #0x9 @ encoding: [0xbf,0xf3,0x49,0x8f]
@ CHECK: dsb #0x8 @ encoding: [0xbf,0xf3,0x48,0x8f]
@ CHECK: dsb nsh @ encoding: [0xbf,0xf3,0x47,0x8f]
@ CHECK: dsb nshst @ encoding: [0xbf,0xf3,0x46,0x8f]
@ CHECK: dsb #0x5 @ encoding: [0xbf,0xf3,0x45,0x8f]
@ CHECK: pssbb @ encoding: [0xbf,0xf3,0x44,0x8f]
@ CHECK: dsb osh @ encoding: [0xbf,0xf3,0x43,0x8f]
@ CHECK: dsb oshst @ encoding: [0xbf,0xf3,0x42,0x8f]
@ CHECK: dsb #0x1 @ encoding: [0xbf,0xf3,0x41,0x8f]
@ CHECK: ssbb @ encoding: [0xbf,0xf3,0x40,0x8f]
@ CHECK: dsb sy @ encoding: [0xbf,0xf3,0x4f,0x8f]
@ CHECK: dsb sy @ encoding: [0xbf,0xf3,0x4f,0x8f]
@ CHECK: dsb st @ encoding: [0xbf,0xf3,0x4e,0x8f]
@ CHECK: dsb ish @ encoding: [0xbf,0xf3,0x4b,0x8f]
@ CHECK: dsb ish @ encoding: [0xbf,0xf3,0x4b,0x8f]
@ CHECK: dsb ishst @ encoding: [0xbf,0xf3,0x4a,0x8f]
@ CHECK: dsb ishst @ encoding: [0xbf,0xf3,0x4a,0x8f]
@ CHECK: dsb nsh @ encoding: [0xbf,0xf3,0x47,0x8f]
@ CHECK: dsb nsh @ encoding: [0xbf,0xf3,0x47,0x8f]
@ CHECK: dsb nshst @ encoding: [0xbf,0xf3,0x46,0x8f]
@ CHECK: dsb nshst @ encoding: [0xbf,0xf3,0x46,0x8f]
@ CHECK: dsb osh @ encoding: [0xbf,0xf3,0x43,0x8f]
@ CHECK: dsb oshst @ encoding: [0xbf,0xf3,0x42,0x8f]
@ CHECK: dsb sy @ encoding: [0xbf,0xf3,0x4f,0x8f]
@ CHECK: dsb sy @ encoding: [0xbf,0xf3,0x4f,0x8f]
@------------------------------------------------------------------------------
@ EOR
@------------------------------------------------------------------------------
eor r4, r5, #0xf000
eor r4, r5, r6
eor r4, r5, r6, lsl #5
eor r4, r5, r6, lsr #5
eor r4, r5, r6, lsr #5
eor r4, r5, r6, asr #5
eor r4, r5, r6, ror #5
@ CHECK: eor r4, r5, #61440 @ encoding: [0x85,0xf4,0x70,0x44]
@ CHECK: eor.w r4, r5, r6 @ encoding: [0x85,0xea,0x06,0x04]
@ CHECK: eor.w r4, r5, r6, lsl #5 @ encoding: [0x85,0xea,0x46,0x14]
@ CHECK: eor.w r4, r5, r6, lsr #5 @ encoding: [0x85,0xea,0x56,0x14]
@ CHECK: eor.w r4, r5, r6, lsr #5 @ encoding: [0x85,0xea,0x56,0x14]
@ CHECK: eor.w r4, r5, r6, asr #5 @ encoding: [0x85,0xea,0x66,0x14]
@ CHECK: eor.w r4, r5, r6, ror #5 @ encoding: [0x85,0xea,0x76,0x14]
@------------------------------------------------------------------------------
@ ISB
@------------------------------------------------------------------------------
isb sy
isb.w sy
isb
isb.w
isb #15
isb #1
@ CHECK: isb sy @ encoding: [0xbf,0xf3,0x6f,0x8f]
@ CHECK: isb sy @ encoding: [0xbf,0xf3,0x6f,0x8f]
@ CHECK: isb sy @ encoding: [0xbf,0xf3,0x6f,0x8f]
@ CHECK: isb sy @ encoding: [0xbf,0xf3,0x6f,0x8f]
@ CHECK: isb sy @ encoding: [0xbf,0xf3,0x6f,0x8f]
@ CHECK: isb #0x1 @ encoding: [0xbf,0xf3,0x61,0x8f]
@------------------------------------------------------------------------------
@ IT
@------------------------------------------------------------------------------
@ Test encodings of a few full IT blocks, not just the IT instruction
iteet eq
addeq r0, r1, r2
nopne
subne r5, r6, r7
addeq r1, r2, #4
@ CHECK: iteet eq @ encoding: [0x0d,0xbf]
@ CHECK: addeq r0, r1, r2 @ encoding: [0x88,0x18]
@ CHECK: nopne @ encoding: [0x00,0xbf]
@ CHECK: subne r5, r6, r7 @ encoding: [0xf5,0x1b]
@ CHECK: addeq r1, r2, #4 @ encoding: [0x11,0x1d]
@ Should also work for UPPER CASE condition codes.
ITEET EQ
ADDEQ R0, R1, R2
NOPNE
SUBNE R5, R6, R7
ADDEQ R1, R2, #4
@ CHECK: iteet eq @ encoding: [0x0d,0xbf]
@ CHECK: addeq r0, r1, r2 @ encoding: [0x88,0x18]
@ CHECK: nopne @ encoding: [0x00,0xbf]
@ CHECK: subne r5, r6, r7 @ encoding: [0xf5,0x1b]
@ CHECK: addeq r1, r2, #4 @ encoding: [0x11,0x1d]
@------------------------------------------------------------------------------
@ LDC{L}/LDC2{L}
@------------------------------------------------------------------------------
ldc2 p0, c8, [r1, #4]
ldc2 p1, c7, [r2]
ldc2 p2, c6, [r3, #-224]
ldc2 p3, c5, [r4, #-120]!
ldc2 p4, c4, [r5], #16
ldc2 p5, c3, [r6], #-72
ldc2l p6, c2, [r7, #4]
ldc2l p7, c1, [r8]
ldc2l p8, c0, [r9, #-224]
ldc2l p9, c1, [r10, #-120]!
ldc2l p0, c2, [r11], #16
ldc2l p1, c3, [r12], #-72
ldc p12, c4, [r0, #4]
ldc p13, c5, [r1]
ldc p14, c6, [r2, #-224]
ldc p15, c7, [r3, #-120]!
ldc p5, c8, [r4], #16
ldc p4, c9, [r5], #-72
ldcl p3, c10, [r6, #4]
ldcl p2, c11, [r7]
ldcl p1, c12, [r8, #-224]
ldcl p0, c13, [r9, #-120]!
ldcl p6, c14, [r10], #16
ldcl p7, c15, [r11], #-72
ldc2 p2, c8, [r1], { 25 }
@ CHECK: ldc2 p0, c8, [r1, #4] @ encoding: [0x91,0xfd,0x01,0x80]
@ CHECK: ldc2 p1, c7, [r2] @ encoding: [0x92,0xfd,0x00,0x71]
@ CHECK: ldc2 p2, c6, [r3, #-224] @ encoding: [0x13,0xfd,0x38,0x62]
@ CHECK: ldc2 p3, c5, [r4, #-120]! @ encoding: [0x34,0xfd,0x1e,0x53]
@ CHECK: ldc2 p4, c4, [r5], #16 @ encoding: [0xb5,0xfc,0x04,0x44]
@ CHECK: ldc2 p5, c3, [r6], #-72 @ encoding: [0x36,0xfc,0x12,0x35]
@ CHECK: ldc2l p6, c2, [r7, #4] @ encoding: [0xd7,0xfd,0x01,0x26]
@ CHECK: ldc2l p7, c1, [r8] @ encoding: [0xd8,0xfd,0x00,0x17]
@ CHECK: ldc2l p8, c0, [r9, #-224] @ encoding: [0x59,0xfd,0x38,0x08]
@ CHECK: ldc2l p9, c1, [r10, #-120]! @ encoding: [0x7a,0xfd,0x1e,0x19]
@ CHECK: ldc2l p0, c2, [r11], #16 @ encoding: [0xfb,0xfc,0x04,0x20]
@ CHECK: ldc2l p1, c3, [r12], #-72 @ encoding: [0x7c,0xfc,0x12,0x31]
@ CHECK: ldc p12, c4, [r0, #4] @ encoding: [0x90,0xed,0x01,0x4c]
@ CHECK: ldc p13, c5, [r1] @ encoding: [0x91,0xed,0x00,0x5d]
@ CHECK: ldc p14, c6, [r2, #-224] @ encoding: [0x12,0xed,0x38,0x6e]
@ CHECK: ldc p15, c7, [r3, #-120]! @ encoding: [0x33,0xed,0x1e,0x7f]
@ CHECK: ldc p5, c8, [r4], #16 @ encoding: [0xb4,0xec,0x04,0x85]
@ CHECK: ldc p4, c9, [r5], #-72 @ encoding: [0x35,0xec,0x12,0x94]
@ CHECK: ldcl p3, c10, [r6, #4] @ encoding: [0xd6,0xed,0x01,0xa3]
@ CHECK: ldcl p2, c11, [r7] @ encoding: [0xd7,0xed,0x00,0xb2]
@ CHECK: ldcl p1, c12, [r8, #-224] @ encoding: [0x58,0xed,0x38,0xc1]
@ CHECK: ldcl p0, c13, [r9, #-120]! @ encoding: [0x79,0xed,0x1e,0xd0]
@ CHECK: ldcl p6, c14, [r10], #16 @ encoding: [0xfa,0xec,0x04,0xe6]
@ CHECK: ldcl p7, c15, [r11], #-72 @ encoding: [0x7b,0xec,0x12,0xf7]
@ CHECK: ldc2 p2, c8, [r1], {25} @ encoding: [0x91,0xfc,0x19,0x82]
@------------------------------------------------------------------------------
@ LDMIA
@------------------------------------------------------------------------------
ldmia.w r4, {r4, r5, r8, r9}
ldmia.w r4, {r5, r6}
ldmia.w r5!, {r3, r8}
ldm.w r4, {r4, r5, r8, r9}
ldm.w r4, {r5, r6}
ldm.w r5!, {r3, r8}
ldm.w r5!, {r1, r2}
ldm.w r2, {r1, r2}
ldmia r4, {r4, r5, r8, r9}
ldmia r4, {r5, r6}
ldmia r5!, {r3, r8}
ldm r4, {r4, r5, r8, r9}
ldm r4, {r5, r6}
ldm r5!, {r3, r8}
ldmfd r5!, {r3, r8}
ldmia sp!, {r4-r11, pc}
@ CHECK: ldm.w r4, {r4, r5, r8, r9} @ encoding: [0x94,0xe8,0x30,0x03]
@ CHECK: ldm.w r4, {r5, r6} @ encoding: [0x94,0xe8,0x60,0x00]
@ CHECK: ldm.w r5!, {r3, r8} @ encoding: [0xb5,0xe8,0x08,0x01]
@ CHECK: ldm.w r4, {r4, r5, r8, r9} @ encoding: [0x94,0xe8,0x30,0x03]
@ CHECK: ldm.w r4, {r5, r6} @ encoding: [0x94,0xe8,0x60,0x00]
@ CHECK: ldm.w r5!, {r3, r8} @ encoding: [0xb5,0xe8,0x08,0x01]
@ CHECK: ldm.w r5!, {r1, r2} @ encoding: [0xb5,0xe8,0x06,0x00]
@ CHECK: ldm.w r2, {r1, r2} @ encoding: [0x92,0xe8,0x06,0x00]
@ CHECK: ldm.w r4, {r4, r5, r8, r9} @ encoding: [0x94,0xe8,0x30,0x03]
@ CHECK: ldm.w r4, {r5, r6} @ encoding: [0x94,0xe8,0x60,0x00]
@ CHECK: ldm.w r5!, {r3, r8} @ encoding: [0xb5,0xe8,0x08,0x01]
@ CHECK: ldm.w r4, {r4, r5, r8, r9} @ encoding: [0x94,0xe8,0x30,0x03]
@ CHECK: ldm.w r4, {r5, r6} @ encoding: [0x94,0xe8,0x60,0x00]
@ CHECK: ldm.w r5!, {r3, r8} @ encoding: [0xb5,0xe8,0x08,0x01]
@ CHECK: ldm.w r5!, {r3, r8} @ encoding: [0xb5,0xe8,0x08,0x01]
@ CHECK: pop.w {r4, r5, r6, r7, r8, r9, r10, r11, pc} @ encoding: [0xbd,0xe8,0xf0,0x8f]
@------------------------------------------------------------------------------
@ LDMDB
@------------------------------------------------------------------------------
ldmdb r4, {r4, r5, r8, r9}
ldmdb r4, {r5, r6}
ldmdb r5!, {r3, r8}
ldmea r5!, {r3, r8}
ldmdb.w r4, {r5, r6}
ldmdb.w r5!, {r3, r8}
@ CHECK: ldmdb r4, {r4, r5, r8, r9} @ encoding: [0x14,0xe9,0x30,0x03]
@ CHECK: ldmdb r4, {r5, r6} @ encoding: [0x14,0xe9,0x60,0x00]
@ CHECK: ldmdb r5!, {r3, r8} @ encoding: [0x35,0xe9,0x08,0x01]
@ CHECK: ldmdb r5!, {r3, r8} @ encoding: [0x35,0xe9,0x08,0x01]
@ CHECK: ldmdb r4, {r5, r6} @ encoding: [0x14,0xe9,0x60,0x00]
@ CHECK: ldmdb r5!, {r3, r8} @ encoding: [0x35,0xe9,0x08,0x01]
@------------------------------------------------------------------------------
@ LDR(immediate)
@------------------------------------------------------------------------------
ldr r5, [r5, #-4]
ldr r5, [r6, #32]
ldr r5, [r6, #33]
ldr r5, [r6, #257]
ldr.w pc, [r7, #257]
ldr r2, [r4, #255]!
ldr r8, [sp, #4]!
ldr lr, [sp, #-4]!
ldr r2, [r4], #255
ldr r8, [sp], #4
ldr lr, [sp], #-4
@ CHECK: ldr r5, [r5, #-4] @ encoding: [0x55,0xf8,0x04,0x5c]
@ CHECK: ldr r5, [r6, #32] @ encoding: [0x35,0x6a]
@ CHECK: ldr.w r5, [r6, #33] @ encoding: [0xd6,0xf8,0x21,0x50]
@ CHECK: ldr.w r5, [r6, #257] @ encoding: [0xd6,0xf8,0x01,0x51]
@ CHECK: ldr.w pc, [r7, #257] @ encoding: [0xd7,0xf8,0x01,0xf1]
@ CHECK: ldr r2, [r4, #255]! @ encoding: [0x54,0xf8,0xff,0x2f]
@ CHECK: ldr r8, [sp, #4]! @ encoding: [0x5d,0xf8,0x04,0x8f]
@ CHECK: ldr lr, [sp, #-4]! @ encoding: [0x5d,0xf8,0x04,0xed]
@ CHECK: ldr r2, [r4], #255 @ encoding: [0x54,0xf8,0xff,0x2b]
@ CHECK: ldr r8, [sp], #4 @ encoding: [0x5d,0xf8,0x04,0x8b]
@ CHECK: ldr lr, [sp], #-4 @ encoding: [0x5d,0xf8,0x04,0xe9]
@------------------------------------------------------------------------------
@ LDR(literal)
@------------------------------------------------------------------------------
ldr.w r5, _foo
ldr lr, (_strcmp-4)
ldr sp, _foo
ldr pc, _foo
@ CHECK: ldr.w r5, _foo @ encoding: [0x5f'A',0xf8'A',A,0x50'A']
@ CHECK: @ fixup A - offset: 0, value: _foo, kind: fixup_t2_ldst_pcrel_12
@ CHECK-BE: ldr.w r5, _foo @ encoding: [0xf8'A',0x5f'A',0x50'A',A]
@ CHECK-BE: @ fixup A - offset: 0, value: _foo, kind: fixup_t2_ldst_pcrel_12
@ CHECK: ldr.w lr, _strcmp-4 @ encoding: [0x5f'A',0xf8'A',A,0xe0'A']
@ CHECK: @ fixup A - offset: 0, value: _strcmp-4, kind: fixup_t2_ldst_pcrel_12
@ CHECK-BE: ldr.w lr, _strcmp-4 @ encoding: [0xf8'A',0x5f'A',0xe0'A',A]
@ CHECK-BE: @ fixup A - offset: 0, value: _strcmp-4, kind: fixup_t2_ldst_pcrel_12
@ CHECK: ldr.w sp, _foo @ encoding: [0x5f'A',0xf8'A',A,0xd0'A']
@ CHECK: @ fixup A - offset: 0, value: _foo, kind: fixup_t2_ldst_pcrel_12
@ CHECK-BE: ldr.w sp, _foo @ encoding: [0xf8'A',0x5f'A',0xd0'A',A]
@ CHECK-BE: @ fixup A - offset: 0, value: _foo, kind: fixup_t2_ldst_pcrel_12
@ CHECK: ldr.w pc, _foo @ encoding: [0x5f'A',0xf8'A',A,0xf0'A']
@ CHECK: @ fixup A - offset: 0, value: _foo, kind: fixup_t2_ldst_pcrel_12
@ CHECK-BE: ldr.w pc, _foo @ encoding: [0xf8'A',0x5f'A',0xf0'A',A]
@ CHECK-BE: @ fixup A - offset: 0, value: _foo, kind: fixup_t2_ldst_pcrel_12
ldr r7, [pc, #8]
ldr.n r7, [pc, #8]
ldr.w r7, [pc, #8]
ldr r4, [pc, #1020]
ldr r3, [pc, #-1020]
ldr r6, [pc, #1024]
ldr r0, [pc, #-1024]
ldr r2, [pc, #4095]
ldr r1, [pc, #-4095]
ldr r8, [pc, #132]
ldr pc, [pc, #256]
ldr pc, [pc, #-400]
ldr sp, [pc, #4]
@ CHECK: ldr r7, [pc, #8] @ encoding: [0x02,0x4f]
@ CHECK: ldr r7, [pc, #8] @ encoding: [0x02,0x4f]
@ CHECK: ldr.w r7, [pc, #8] @ encoding: [0xdf,0xf8,0x08,0x70]
@ CHECK: ldr r4, [pc, #1020] @ encoding: [0xff,0x4c]
@ CHECK: ldr.w r3, [pc, #-1020] @ encoding: [0x5f,0xf8,0xfc,0x33]
@ CHECK: ldr.w r6, [pc, #1024] @ encoding: [0xdf,0xf8,0x00,0x64]
@ CHECK: ldr.w r0, [pc, #-1024] @ encoding: [0x5f,0xf8,0x00,0x04]
@ CHECK: ldr.w r2, [pc, #4095] @ encoding: [0xdf,0xf8,0xff,0x2f]
@ CHECK: ldr.w r1, [pc, #-4095] @ encoding: [0x5f,0xf8,0xff,0x1f]
@ CHECK: ldr.w r8, [pc, #132] @ encoding: [0xdf,0xf8,0x84,0x80]
@ CHECK: ldr.w pc, [pc, #256] @ encoding: [0xdf,0xf8,0x00,0xf1]
@ CHECK: ldr.w pc, [pc, #-400] @ encoding: [0x5f,0xf8,0x90,0xf1]
@ CHECK: ldr.w sp, [pc, #4] @ encoding: [0xdf,0xf8,0x04,0xd0]
ldrb r9, [pc, #-0]
ldrsb r11, [pc, #-0]
ldrh r10, [pc, #-0]
ldrsh r1, [pc, #-0]
ldr r5, [pc, #-0]
@ CHECK: ldrb.w r9, [pc, #-0] @ encoding: [0x1f,0xf8,0x00,0x90]
@ CHECK: ldrsb.w r11, [pc, #-0] @ encoding: [0x1f,0xf9,0x00,0xb0]
@ CHECK: ldrh.w r10, [pc, #-0] @ encoding: [0x3f,0xf8,0x00,0xa0]
@ CHECK: ldrsh.w r1, [pc, #-0] @ encoding: [0x3f,0xf9,0x00,0x10]
@ CHECK: ldr.w r5, [pc, #-0] @ encoding: [0x5f,0xf8,0x00,0x50]
@------------------------------------------------------------------------------
@ LDR(register)
@------------------------------------------------------------------------------
ldr r1, [r8, r1]
ldr.w r4, [r5, r2]
ldr r6, [r0, r2, lsl #3]
ldr r8, [r8, r2, lsl #2]
ldr r7, [sp, r2, lsl #1]
ldr r7, [sp, r2, lsl #0]
@ CHECK: ldr.w r1, [r8, r1] @ encoding: [0x58,0xf8,0x01,0x10]
@ CHECK: ldr.w r4, [r5, r2] @ encoding: [0x55,0xf8,0x02,0x40]
@ CHECK: ldr.w r6, [r0, r2, lsl #3] @ encoding: [0x50,0xf8,0x32,0x60]
@ CHECK: ldr.w r8, [r8, r2, lsl #2] @ encoding: [0x58,0xf8,0x22,0x80]
@ CHECK: ldr.w r7, [sp, r2, lsl #1] @ encoding: [0x5d,0xf8,0x12,0x70]
@ CHECK: ldr.w r7, [sp, r2] @ encoding: [0x5d,0xf8,0x02,0x70]
@------------------------------------------------------------------------------
@ LDRB(immediate)
@------------------------------------------------------------------------------
ldrb r5, [r5, #-4]
ldrb r5, [r6, #32]
ldrb r5, [r6, #33]
ldrb r5, [r6, #257]
ldrb.w lr, [r7, #257]
ldrb r5, [r8, #255]!
ldrb r2, [r5, #4]!
ldrb r1, [r4, #-4]!
ldrb lr, [r3], #255
ldrb r9, [r2], #4
ldrb r3, [sp], #-4
ldrb.w r5, [r5, #-4]
ldrb.w r5, [r6, #32]
ldrb.w r5, [r8, #255]!
ldrb.w r9, [r2], #4
@ CHECK: ldrb r5, [r5, #-4] @ encoding: [0x15,0xf8,0x04,0x5c]
@ CHECK: ldrb.w r5, [r6, #32] @ encoding: [0x96,0xf8,0x20,0x50]
@ CHECK: ldrb.w r5, [r6, #33] @ encoding: [0x96,0xf8,0x21,0x50]
@ CHECK: ldrb.w r5, [r6, #257] @ encoding: [0x96,0xf8,0x01,0x51]
@ CHECK: ldrb.w lr, [r7, #257] @ encoding: [0x97,0xf8,0x01,0xe1]
@ CHECK: ldrb r5, [r8, #255]! @ encoding: [0x18,0xf8,0xff,0x5f]
@ CHECK: ldrb r2, [r5, #4]! @ encoding: [0x15,0xf8,0x04,0x2f]
@ CHECK: ldrb r1, [r4, #-4]! @ encoding: [0x14,0xf8,0x04,0x1d]
@ CHECK: ldrb lr, [r3], #255 @ encoding: [0x13,0xf8,0xff,0xeb]
@ CHECK: ldrb r9, [r2], #4 @ encoding: [0x12,0xf8,0x04,0x9b]
@ CHECK: ldrb r3, [sp], #-4 @ encoding: [0x1d,0xf8,0x04,0x39]
@ CHECK: ldrb r5, [r5, #-4] @ encoding: [0x15,0xf8,0x04,0x5c]
@ CHECK: ldrb.w r5, [r6, #32] @ encoding: [0x96,0xf8,0x20,0x50]
@ CHECK: ldrb r5, [r8, #255]! @ encoding: [0x18,0xf8,0xff,0x5f]
@ CHECK: ldrb r9, [r2], #4 @ encoding: [0x12,0xf8,0x04,0x9b]
@------------------------------------------------------------------------------
@ LDRB(register)
@------------------------------------------------------------------------------
ldrb r1, [r8, r1]
ldrb.w r4, [r5, r2]
ldrb r6, [r0, r2, lsl #3]
ldrb r8, [r8, r2, lsl #2]
ldrb r7, [sp, r2, lsl #1]
ldrb r7, [sp, r2, lsl #0]
@ CHECK: ldrb.w r1, [r8, r1] @ encoding: [0x18,0xf8,0x01,0x10]
@ CHECK: ldrb.w r4, [r5, r2] @ encoding: [0x15,0xf8,0x02,0x40]
@ CHECK: ldrb.w r6, [r0, r2, lsl #3] @ encoding: [0x10,0xf8,0x32,0x60]
@ CHECK: ldrb.w r8, [r8, r2, lsl #2] @ encoding: [0x18,0xf8,0x22,0x80]
@ CHECK: ldrb.w r7, [sp, r2, lsl #1] @ encoding: [0x1d,0xf8,0x12,0x70]
@ CHECK: ldrb.w r7, [sp, r2] @ encoding: [0x1d,0xf8,0x02,0x70]
@------------------------------------------------------------------------------
@ LDRBT
@------------------------------------------------------------------------------
ldrbt r1, [r2]
ldrbt r1, [r8, #0]
ldrbt r1, [r8, #3]
ldrbt r1, [r8, #255]
@ CHECK: ldrbt r1, [r2] @ encoding: [0x12,0xf8,0x00,0x1e]
@ CHECK: ldrbt r1, [r8] @ encoding: [0x18,0xf8,0x00,0x1e]
@ CHECK: ldrbt r1, [r8, #3] @ encoding: [0x18,0xf8,0x03,0x1e]
@ CHECK: ldrbt r1, [r8, #255] @ encoding: [0x18,0xf8,0xff,0x1e]
@------------------------------------------------------------------------------
@ LDRD
@------------------------------------------------------------------------------
ldrd r3, r5, [r6, #24]
ldrd r3, r5, [r6, #24]!
ldrd r3, r5, [r6], #4
ldrd r3, r5, [r6], #-8
ldrd r3, r5, [r6]
ldrd r8, r1, [r3, #0]
ldrd r0, r1, [r2, #-0]
ldrd r0, r1, [r2, #-0]!
ldrd r0, r1, [r2], #-0
@ CHECK: ldrd r3, r5, [r6, #24] @ encoding: [0xd6,0xe9,0x06,0x35]
@ CHECK: ldrd r3, r5, [r6, #24]! @ encoding: [0xf6,0xe9,0x06,0x35]
@ CHECK: ldrd r3, r5, [r6], #4 @ encoding: [0xf6,0xe8,0x01,0x35]
@ CHECK: ldrd r3, r5, [r6], #-8 @ encoding: [0x76,0xe8,0x02,0x35]
@ CHECK: ldrd r3, r5, [r6] @ encoding: [0xd6,0xe9,0x00,0x35]
@ CHECK: ldrd r8, r1, [r3] @ encoding: [0xd3,0xe9,0x00,0x81]
@ CHECK: ldrd r0, r1, [r2, #-0] @ encoding: [0x52,0xe9,0x00,0x01]
@ CHECK: ldrd r0, r1, [r2, #-0]! @ encoding: [0x72,0xe9,0x00,0x01]
@ CHECK: ldrd r0, r1, [r2], #-0 @ encoding: [0x72,0xe8,0x00,0x01]
@------------------------------------------------------------------------------
@ FIXME: LDRD(literal)
@------------------------------------------------------------------------------
@------------------------------------------------------------------------------
@ LDREX/LDREXB/LDREXH/LDREXD
@------------------------------------------------------------------------------
ldrex r1, [r4]
ldrex r8, [r4, #0]
ldrex r2, [sp, #128]
ldrexb r5, [r7]
ldrexh r9, [r12]
ldrexd r9, r3, [r4]
@ CHECK: ldrex r1, [r4] @ encoding: [0x54,0xe8,0x00,0x1f]
@ CHECK: ldrex r8, [r4] @ encoding: [0x54,0xe8,0x00,0x8f]
@ CHECK: ldrex r2, [sp, #128] @ encoding: [0x5d,0xe8,0x20,0x2f]
@ CHECK: ldrexb r5, [r7] @ encoding: [0xd7,0xe8,0x4f,0x5f]
@ CHECK: ldrexh r9, [r12] @ encoding: [0xdc,0xe8,0x5f,0x9f]
@ CHECK: ldrexd r9, r3, [r4] @ encoding: [0xd4,0xe8,0x7f,0x93]
@------------------------------------------------------------------------------
@ LDRH(immediate)
@------------------------------------------------------------------------------
ldrh r5, [r5, #-4]
ldrh r5, [r6, #32]
ldrh r5, [r6, #33]
ldrh r5, [r6, #257]
ldrh.w lr, [r7, #257]
ldrh r5, [r8, #255]!
ldrh r2, [r5, #4]!
ldrh r1, [r4, #-4]!
ldrh lr, [r3], #255
ldrh r9, [r2], #4
ldrh r3, [sp], #-4
ldrh.w r5, [r5, #-4]
ldrh.w r5, [r6, #32]
ldrh.w r5, [r8, #255]!
ldrh.w r9, [r2], #4
@ CHECK: ldrh r5, [r5, #-4] @ encoding: [0x35,0xf8,0x04,0x5c]
@ CHECK: ldrh r5, [r6, #32] @ encoding: [0x35,0x8c]
@ CHECK: ldrh.w r5, [r6, #33] @ encoding: [0xb6,0xf8,0x21,0x50]
@ CHECK: ldrh.w r5, [r6, #257] @ encoding: [0xb6,0xf8,0x01,0x51]
@ CHECK: ldrh.w lr, [r7, #257] @ encoding: [0xb7,0xf8,0x01,0xe1]
@ CHECK: ldrh r5, [r8, #255]! @ encoding: [0x38,0xf8,0xff,0x5f]
@ CHECK: ldrh r2, [r5, #4]! @ encoding: [0x35,0xf8,0x04,0x2f]
@ CHECK: ldrh r1, [r4, #-4]! @ encoding: [0x34,0xf8,0x04,0x1d]
@ CHECK: ldrh lr, [r3], #255 @ encoding: [0x33,0xf8,0xff,0xeb]
@ CHECK: ldrh r9, [r2], #4 @ encoding: [0x32,0xf8,0x04,0x9b]
@ CHECK: ldrh r3, [sp], #-4 @ encoding: [0x3d,0xf8,0x04,0x39]
@ CHECK: ldrh r5, [r5, #-4] @ encoding: [0x35,0xf8,0x04,0x5c]
@ CHECK: ldrh.w r5, [r6, #32] @ encoding: [0xb6,0xf8,0x20,0x50]
@ CHECK: ldrh r5, [r8, #255]! @ encoding: [0x38,0xf8,0xff,0x5f]
@ CHECK: ldrh r9, [r2], #4 @ encoding: [0x32,0xf8,0x04,0x9b]
@------------------------------------------------------------------------------
@ LDRH(register)
@------------------------------------------------------------------------------
ldrh r1, [r8, r1]
ldrh.w r4, [r5, r2]
ldrh r6, [r0, r2, lsl #3]
ldrh r8, [r8, r2, lsl #2]
ldrh r7, [sp, r2, lsl #1]
ldrh r7, [sp, r2, lsl #0]
@ CHECK: ldrh.w r1, [r8, r1] @ encoding: [0x38,0xf8,0x01,0x10]
@ CHECK: ldrh.w r4, [r5, r2] @ encoding: [0x35,0xf8,0x02,0x40]
@ CHECK: ldrh.w r6, [r0, r2, lsl #3] @ encoding: [0x30,0xf8,0x32,0x60]
@ CHECK: ldrh.w r8, [r8, r2, lsl #2] @ encoding: [0x38,0xf8,0x22,0x80]
@ CHECK: ldrh.w r7, [sp, r2, lsl #1] @ encoding: [0x3d,0xf8,0x12,0x70]
@ CHECK: ldrh.w r7, [sp, r2] @ encoding: [0x3d,0xf8,0x02,0x70]
@------------------------------------------------------------------------------
@ LDRH(literal)
@------------------------------------------------------------------------------
ldrh r5, _bar
@ CHECK: ldrh.w r5, _bar @ encoding: [0x3f'A',0xf8'A',A,0x50'A']
@ CHECK: @ fixup A - offset: 0, value: _bar, kind: fixup_t2_ldst_pcrel_12
@ CHECK-BE: ldrh.w r5, _bar @ encoding: [0xf8'A',0x3f'A',0x50'A',A]
@ CHECK-BE: @ fixup A - offset: 0, value: _bar, kind: fixup_t2_ldst_pcrel_12
@------------------------------------------------------------------------------
@ LDRHT
@------------------------------------------------------------------------------
ldrht r1, [r2]
ldrht r1, [r8, #0]
ldrht r1, [r8, #3]
ldrht r1, [r8, #255]
@ CHECK: ldrht r1, [r2] @ encoding: [0x32,0xf8,0x00,0x1e]
@ CHECK: ldrht r1, [r8] @ encoding: [0x38,0xf8,0x00,0x1e]
@ CHECK: ldrht r1, [r8, #3] @ encoding: [0x38,0xf8,0x03,0x1e]
@ CHECK: ldrht r1, [r8, #255] @ encoding: [0x38,0xf8,0xff,0x1e]
@------------------------------------------------------------------------------
@ LDRSB(immediate)
@------------------------------------------------------------------------------
ldrsb r5, [r5, #-4]
ldrsb r5, [r6, #32]
ldrsb r5, [r6, #33]
ldrsb r5, [r6, #257]
ldrsb.w lr, [r7, #257]
ldrsb r5, [r8, #255]!
ldrsb r2, [r5, #4]!
ldrsb r1, [r4, #-4]!
ldrsb lr, [r3], #255
ldrsb r9, [r2], #4
ldrsb r3, [sp], #-4
ldrsb.w r5, [r5, #-4]
ldrsb.w r5, [r6, #32]
ldrsb.w r5, [r8, #255]!
ldrsb.w r9, [r2], #4
@ CHECK: ldrsb r5, [r5, #-4] @ encoding: [0x15,0xf9,0x04,0x5c]
@ CHECK: ldrsb.w r5, [r6, #32] @ encoding: [0x96,0xf9,0x20,0x50]
@ CHECK: ldrsb.w r5, [r6, #33] @ encoding: [0x96,0xf9,0x21,0x50]
@ CHECK: ldrsb.w r5, [r6, #257] @ encoding: [0x96,0xf9,0x01,0x51]
@ CHECK: ldrsb.w lr, [r7, #257] @ encoding: [0x97,0xf9,0x01,0xe1]
@ CHECK: ldrsb r5, [r8, #255]! @ encoding: [0x18,0xf9,0xff,0x5f]
@ CHECK: ldrsb r2, [r5, #4]! @ encoding: [0x15,0xf9,0x04,0x2f]
@ CHECK: ldrsb r1, [r4, #-4]! @ encoding: [0x14,0xf9,0x04,0x1d]
@ CHECK: ldrsb lr, [r3], #255 @ encoding: [0x13,0xf9,0xff,0xeb]
@ CHECK: ldrsb r9, [r2], #4 @ encoding: [0x12,0xf9,0x04,0x9b]
@ CHECK: ldrsb r3, [sp], #-4 @ encoding: [0x1d,0xf9,0x04,0x39]
@ CHECK: ldrsb r5, [r5, #-4] @ encoding: [0x15,0xf9,0x04,0x5c]
@ CHECK: ldrsb.w r5, [r6, #32] @ encoding: [0x96,0xf9,0x20,0x50]
@ CHECK: ldrsb r5, [r8, #255]! @ encoding: [0x18,0xf9,0xff,0x5f]
@ CHECK: ldrsb r9, [r2], #4 @ encoding: [0x12,0xf9,0x04,0x9b]
@------------------------------------------------------------------------------
@ LDRSB(register)
@------------------------------------------------------------------------------
ldrsb r1, [r8, r1]
ldrsb.w r4, [r5, r2]
ldrsb r6, [r0, r2, lsl #3]
ldrsb r8, [r8, r2, lsl #2]
ldrsb r7, [sp, r2, lsl #1]
ldrsb r7, [sp, r2, lsl #0]
ldrsb r5, [r8, #255]!
ldrsb r2, [r5, #4]!
ldrsb r1, [r4, #-4]!
ldrsb lr, [r3], #255
ldrsb r9, [r2], #4
ldrsb r3, [sp], #-4
@ CHECK: ldrsb.w r1, [r8, r1] @ encoding: [0x18,0xf9,0x01,0x10]
@ CHECK: ldrsb.w r4, [r5, r2] @ encoding: [0x15,0xf9,0x02,0x40]
@ CHECK: ldrsb.w r6, [r0, r2, lsl #3] @ encoding: [0x10,0xf9,0x32,0x60]
@ CHECK: ldrsb.w r8, [r8, r2, lsl #2] @ encoding: [0x18,0xf9,0x22,0x80]
@ CHECK: ldrsb.w r7, [sp, r2, lsl #1] @ encoding: [0x1d,0xf9,0x12,0x70]
@ CHECK: ldrsb.w r7, [sp, r2] @ encoding: [0x1d,0xf9,0x02,0x70]
@ CHECK: ldrsb r5, [r8, #255]! @ encoding: [0x18,0xf9,0xff,0x5f]
@ CHECK: ldrsb r2, [r5, #4]! @ encoding: [0x15,0xf9,0x04,0x2f]
@ CHECK: ldrsb r1, [r4, #-4]! @ encoding: [0x14,0xf9,0x04,0x1d]
@ CHECK: ldrsb lr, [r3], #255 @ encoding: [0x13,0xf9,0xff,0xeb]
@ CHECK: ldrsb r9, [r2], #4 @ encoding: [0x12,0xf9,0x04,0x9b]
@ CHECK: ldrsb r3, [sp], #-4 @ encoding: [0x1d,0xf9,0x04,0x39]
@------------------------------------------------------------------------------
@ LDRSB(literal)
@------------------------------------------------------------------------------
ldrsb r5, _bar
@ CHECK: ldrsb.w r5, _bar @ encoding: [0x1f'A',0xf9'A',A,0x50'A']
@ CHECK: @ fixup A - offset: 0, value: _bar, kind: fixup_t2_ldst_pcrel_12
@ CHECK-BE: ldrsb.w r5, _bar @ encoding: [0xf9'A',0x1f'A',0x50'A',A]
@ CHECK-BE: @ fixup A - offset: 0, value: _bar, kind: fixup_t2_ldst_pcrel_12
@------------------------------------------------------------------------------
@ LDRSBT
@------------------------------------------------------------------------------
ldrsbt r1, [r2]
ldrsbt r1, [r8, #0]
ldrsbt r1, [r8, #3]
ldrsbt r1, [r8, #255]
@ CHECK: ldrsbt r1, [r2] @ encoding: [0x12,0xf9,0x00,0x1e]
@ CHECK: ldrsbt r1, [r8] @ encoding: [0x18,0xf9,0x00,0x1e]
@ CHECK: ldrsbt r1, [r8, #3] @ encoding: [0x18,0xf9,0x03,0x1e]
@ CHECK: ldrsbt r1, [r8, #255] @ encoding: [0x18,0xf9,0xff,0x1e]
@------------------------------------------------------------------------------
@ LDRSH(immediate)
@------------------------------------------------------------------------------
ldrsh r5, [r5, #-4]
ldrsh r5, [r6, #32]
ldrsh r5, [r6, #33]
ldrsh r5, [r6, #257]
ldrsh.w lr, [r7, #257]
ldrsh r5, [r8, #255]!
ldrsh r2, [r5, #4]!
ldrsh r1, [r4, #-4]!
ldrsh lr, [r3], #255
ldrsh r9, [r2], #4
ldrsh r3, [sp], #-4
ldrsh.w r5, [r5, #-4]
ldrsh.w r5, [r6, #32]
ldrsh.w r5, [r8, #255]!
ldrsh.w r9, [r2], #4
@ CHECK: ldrsh r5, [r5, #-4] @ encoding: [0x35,0xf9,0x04,0x5c]
@ CHECK: ldrsh.w r5, [r6, #32] @ encoding: [0xb6,0xf9,0x20,0x50]
@ CHECK: ldrsh.w r5, [r6, #33] @ encoding: [0xb6,0xf9,0x21,0x50]
@ CHECK: ldrsh.w r5, [r6, #257] @ encoding: [0xb6,0xf9,0x01,0x51]
@ CHECK: ldrsh.w lr, [r7, #257] @ encoding: [0xb7,0xf9,0x01,0xe1]
@ CHECK: ldrsh r5, [r8, #255]! @ encoding: [0x38,0xf9,0xff,0x5f]
@ CHECK: ldrsh r2, [r5, #4]! @ encoding: [0x35,0xf9,0x04,0x2f]
@ CHECK: ldrsh r1, [r4, #-4]! @ encoding: [0x34,0xf9,0x04,0x1d]
@ CHECK: ldrsh lr, [r3], #255 @ encoding: [0x33,0xf9,0xff,0xeb]
@ CHECK: ldrsh r9, [r2], #4 @ encoding: [0x32,0xf9,0x04,0x9b]
@ CHECK: ldrsh r3, [sp], #-4 @ encoding: [0x3d,0xf9,0x04,0x39]
@ CHECK: ldrsh r5, [r5, #-4] @ encoding: [0x35,0xf9,0x04,0x5c]
@ CHECK: ldrsh.w r5, [r6, #32] @ encoding: [0xb6,0xf9,0x20,0x50]
@ CHECK: ldrsh r5, [r8, #255]! @ encoding: [0x38,0xf9,0xff,0x5f]
@ CHECK: ldrsh r9, [r2], #4 @ encoding: [0x32,0xf9,0x04,0x9b]
@------------------------------------------------------------------------------
@ LDRSH(register)
@------------------------------------------------------------------------------
ldrsh r1, [r8, r1]
ldrsh.w r4, [r5, r2]
ldrsh r6, [r0, r2, lsl #3]
ldrsh r8, [r8, r2, lsl #2]
ldrsh r7, [sp, r2, lsl #1]
ldrsh r7, [sp, r2, lsl #0]
ldrsh r5, [r8, #255]!
ldrsh r2, [r5, #4]!
ldrsh r1, [r4, #-4]!
ldrsh lr, [r3], #255
ldrsh r9, [r2], #4
ldrsh r3, [sp], #-4
@ CHECK: ldrsh.w r1, [r8, r1] @ encoding: [0x38,0xf9,0x01,0x10]
@ CHECK: ldrsh.w r4, [r5, r2] @ encoding: [0x35,0xf9,0x02,0x40]
@ CHECK: ldrsh.w r6, [r0, r2, lsl #3] @ encoding: [0x30,0xf9,0x32,0x60]
@ CHECK: ldrsh.w r8, [r8, r2, lsl #2] @ encoding: [0x38,0xf9,0x22,0x80]
@ CHECK: ldrsh.w r7, [sp, r2, lsl #1] @ encoding: [0x3d,0xf9,0x12,0x70]
@ CHECK: ldrsh.w r7, [sp, r2] @ encoding: [0x3d,0xf9,0x02,0x70]
@ CHECK: ldrsh r5, [r8, #255]! @ encoding: [0x38,0xf9,0xff,0x5f]
@ CHECK: ldrsh r2, [r5, #4]! @ encoding: [0x35,0xf9,0x04,0x2f]
@ CHECK: ldrsh r1, [r4, #-4]! @ encoding: [0x34,0xf9,0x04,0x1d]
@ CHECK: ldrsh lr, [r3], #255 @ encoding: [0x33,0xf9,0xff,0xeb]
@ CHECK: ldrsh r9, [r2], #4 @ encoding: [0x32,0xf9,0x04,0x9b]
@ CHECK: ldrsh r3, [sp], #-4 @ encoding: [0x3d,0xf9,0x04,0x39]
@------------------------------------------------------------------------------
@ LDRSH(literal)
@------------------------------------------------------------------------------
ldrsh r5, _bar
@ CHECK: ldrsh.w r5, _bar @ encoding: [0x3f'A',0xf9'A',A,0x50'A']
@ CHECK: @ fixup A - offset: 0, value: _bar, kind: fixup_t2_ldst_pcrel_12
@ CHECK-BE: ldrsh.w r5, _bar @ encoding: [0xf9'A',0x3f'A',0x50'A',A]
@ CHECK-BE: @ fixup A - offset: 0, value: _bar, kind: fixup_t2_ldst_pcrel_12
@ TEMPORARILY DISABLED:
@ ldrsh.w r4, [pc, #1435]
@ : ldrsh.w r4, [pc, #1435] @ encoding: [0x3f,0xf9,0x9b,0x45]
@------------------------------------------------------------------------------
@ LDRSHT
@------------------------------------------------------------------------------
ldrsht r1, [r2]
ldrsht r1, [r8, #0]
ldrsht r1, [r8, #3]
ldrsht r1, [r8, #255]
@ CHECK: ldrsht r1, [r2] @ encoding: [0x32,0xf9,0x00,0x1e]
@ CHECK: ldrsht r1, [r8] @ encoding: [0x38,0xf9,0x00,0x1e]
@ CHECK: ldrsht r1, [r8, #3] @ encoding: [0x38,0xf9,0x03,0x1e]
@ CHECK: ldrsht r1, [r8, #255] @ encoding: [0x38,0xf9,0xff,0x1e]
@------------------------------------------------------------------------------
@ LDRT
@------------------------------------------------------------------------------
ldrt r1, [r2]
ldrt r2, [r6, #0]
ldrt r3, [r7, #3]
ldrt r4, [r9, #255]
@ CHECK: ldrt r1, [r2] @ encoding: [0x52,0xf8,0x00,0x1e]
@ CHECK: ldrt r2, [r6] @ encoding: [0x56,0xf8,0x00,0x2e]
@ CHECK: ldrt r3, [r7, #3] @ encoding: [0x57,0xf8,0x03,0x3e]
@ CHECK: ldrt r4, [r9, #255] @ encoding: [0x59,0xf8,0xff,0x4e]
@------------------------------------------------------------------------------
@ LSL (immediate)
@------------------------------------------------------------------------------
lsl r2, r3, #12
lsls r8, r3, #31
lsls.w r2, r3, #1
lsl r2, r3, #4
lsls r2, r12, #15
lsl r3, #19
lsls r8, #2
lsls.w r7, #5
lsl.w r12, #21
lsls r1, r2, #1
itt eq
lslseq r1, r2, #1
lsleq r1, r2, #1
@ CHECK: lsl.w r2, r3, #12 @ encoding: [0x4f,0xea,0x03,0x32]
@ CHECK: lsls.w r8, r3, #31 @ encoding: [0x5f,0xea,0xc3,0x78]
@ CHECK: lsls.w r2, r3, #1 @ encoding: [0x5f,0xea,0x43,0x02]
@ CHECK: lsl.w r2, r3, #4 @ encoding: [0x4f,0xea,0x03,0x12]
@ CHECK: lsls.w r2, r12, #15 @ encoding: [0x5f,0xea,0xcc,0x32]
@ CHECK: lsl.w r3, r3, #19 @ encoding: [0x4f,0xea,0xc3,0x43]
@ CHECK: lsls.w r8, r8, #2 @ encoding: [0x5f,0xea,0x88,0x08]
@ CHECK: lsls.w r7, r7, #5 @ encoding: [0x5f,0xea,0x47,0x17]
@ CHECK: lsl.w r12, r12, #21 @ encoding: [0x4f,0xea,0x4c,0x5c]
@ CHECK: lsls r1, r2, #1 @ encoding: [0x51,0x00]
@ CHECK: itt eq @ encoding: [0x04,0xbf]
@ CHECK: lslseq.w r1, r2, #1 @ encoding: [0x5f,0xea,0x42,0x01]
@ CHECK: lsleq r1, r2, #1 @ encoding: [0x51,0x00]
@------------------------------------------------------------------------------
@ LSL (register)
@------------------------------------------------------------------------------
lsl r3, r4, r2
lsl.w r1, r2
lsls r3, r4, r8
@ CHECK: lsl.w r3, r4, r2 @ encoding: [0x04,0xfa,0x02,0xf3]
@ CHECK: lsl.w r1, r1, r2 @ encoding: [0x01,0xfa,0x02,0xf1]
@ CHECK: lsls.w r3, r4, r8 @ encoding: [0x14,0xfa,0x08,0xf3]
@------------------------------------------------------------------------------
@ LSR (immediate)
@------------------------------------------------------------------------------
lsr r2, r3, #12
lsrs r8, r3, #32
lsrs.w r2, r3, #1
lsr r2, r3, #4
lsrs r2, r12, #15
lsr r3, #19
lsrs r8, #2
lsrs.w r7, #5
lsr.w r12, #21
lsrs r1, r2, #1
itt eq
lsrseq r1, r2, #1
lsreq r1, r2, #1
@ CHECK: lsr.w r2, r3, #12 @ encoding: [0x4f,0xea,0x13,0x32]
@ CHECK: lsrs.w r8, r3, #32 @ encoding: [0x5f,0xea,0x13,0x08]
@ CHECK: lsrs.w r2, r3, #1 @ encoding: [0x5f,0xea,0x53,0x02]
@ CHECK: lsr.w r2, r3, #4 @ encoding: [0x4f,0xea,0x13,0x12]
@ CHECK: lsrs.w r2, r12, #15 @ encoding: [0x5f,0xea,0xdc,0x32]
@ CHECK: lsr.w r3, r3, #19 @ encoding: [0x4f,0xea,0xd3,0x43]
@ CHECK: lsrs.w r8, r8, #2 @ encoding: [0x5f,0xea,0x98,0x08]
@ CHECK: lsrs.w r7, r7, #5 @ encoding: [0x5f,0xea,0x57,0x17]
@ CHECK: lsr.w r12, r12, #21 @ encoding: [0x4f,0xea,0x5c,0x5c]
@ CHECK: lsrs r1, r2, #1 @ encoding: [0x51,0x08]
@ CHECK: itt eq @ encoding: [0x04,0xbf]
@ CHECK: lsrseq.w r1, r2, #1 @ encoding: [0x5f,0xea,0x52,0x01]
@ CHECK: lsreq r1, r2, #1 @ encoding: [0x51,0x08]
@------------------------------------------------------------------------------
@ LSR (register)
@------------------------------------------------------------------------------
lsr r3, r4, r2
lsr.w r1, r2
lsrs r3, r4, r8
@ CHECK: lsr.w r3, r4, r2 @ encoding: [0x24,0xfa,0x02,0xf3]
@ CHECK: lsr.w r1, r1, r2 @ encoding: [0x21,0xfa,0x02,0xf1]
@ CHECK: lsrs.w r3, r4, r8 @ encoding: [0x34,0xfa,0x08,0xf3]
@------------------------------------------------------------------------------
@ MCR/MCR2
@------------------------------------------------------------------------------
mcr p7, #1, r5, c1, c1, #4
mcr2 p7, #1, r5, c1, c1, #4
mcr p14, #0, r4, c0, c5
mcr2 p4, #2, r2, c1, c3
MCR P7, #1, R5, C1, C1, #4
MCR2 P7, #1, R5, C1, C1, #4
MCR P14, #0, R4, C0, C5
MCR2 P4, #2, R2, C1, C3
@ CHECK: mcr p7, #1, r5, c1, c1, #4 @ encoding: [0x21,0xee,0x91,0x57]
@ CHECK: mcr2 p7, #1, r5, c1, c1, #4 @ encoding: [0x21,0xfe,0x91,0x57]
@ CHECK: mcr p14, #0, r4, c0, c5, #0 @ encoding: [0x00,0xee,0x15,0x4e]
@ CHECK: mcr2 p4, #2, r2, c1, c3, #0 @ encoding: [0x41,0xfe,0x13,0x24]
@ CHECK: mcr p7, #1, r5, c1, c1, #4 @ encoding: [0x21,0xee,0x91,0x57]
@ CHECK: mcr2 p7, #1, r5, c1, c1, #4 @ encoding: [0x21,0xfe,0x91,0x57]
@ CHECK: mcr p14, #0, r4, c0, c5, #0 @ encoding: [0x00,0xee,0x15,0x4e]
@ CHECK: mcr2 p4, #2, r2, c1, c3, #0 @ encoding: [0x41,0xfe,0x13,0x24]
@------------------------------------------------------------------------------
@ MCRR/MCRR2
@------------------------------------------------------------------------------
mcrr p7, #15, r5, r4, c1
mcrr2 p7, #15, r5, r4, c1
MCRR P7, #15, R5, R4, C1
MCRR2 P7, #15, R5, R4, C1
@ CHECK: mcrr p7, #15, r5, r4, c1 @ encoding: [0x44,0xec,0xf1,0x57]
@ CHECK: mcrr2 p7, #15, r5, r4, c1 @ encoding: [0x44,0xfc,0xf1,0x57]
@ CHECK: mcrr p7, #15, r5, r4, c1 @ encoding: [0x44,0xec,0xf1,0x57]
@ CHECK: mcrr2 p7, #15, r5, r4, c1 @ encoding: [0x44,0xfc,0xf1,0x57]
@------------------------------------------------------------------------------
@ MLA/MLS
@------------------------------------------------------------------------------
mla r1,r2,r3,r4
mls r1,r2,r3,r4
@ CHECK: mla r1, r2, r3, r4 @ encoding: [0x02,0xfb,0x03,0x41]
@ CHECK: mls r1, r2, r3, r4 @ encoding: [0x02,0xfb,0x13,0x41]
@------------------------------------------------------------------------------
@ MOV(immediate)
@------------------------------------------------------------------------------
movs r1, #21
movs.w r1, #21
movs r8, #21
movw r0, #65535
movw r1, #43777
movw r1, #43792
mov.w r0, #0x3fc0000
mov r0, #0x3fc0000
movs.w r0, #0x3fc0000
itte eq
movseq r1, #12
moveq r1, #12
movne.w r1, #12
mov.w r6, #450
it lo
movlo r1, #-1
@ alias for mvn
mov r3, #-3
mov r11, #0xabcd
movs r0, #1
it ne
movne r3, #15
itt eq
moveq r0, #255
moveq r1, #256
@ CHECK: movs r1, #21 @ encoding: [0x15,0x21]
@ CHECK: movs.w r1, #21 @ encoding: [0x5f,0xf0,0x15,0x01]
@ CHECK: movs.w r8, #21 @ encoding: [0x5f,0xf0,0x15,0x08]
@ CHECK: movw r0, #65535 @ encoding: [0x4f,0xf6,0xff,0x70]
@ CHECK: movw r1, #43777 @ encoding: [0x4a,0xf6,0x01,0x31]
@ CHECK: movw r1, #43792 @ encoding: [0x4a,0xf6,0x10,0x31]
@ CHECK: mov.w r0, #66846720 @ encoding: [0x4f,0xf0,0x7f,0x70]
@ CHECK: mov.w r0, #66846720 @ encoding: [0x4f,0xf0,0x7f,0x70]
@ CHECK: movs.w r0, #66846720 @ encoding: [0x5f,0xf0,0x7f,0x70]
@ CHECK: itte eq @ encoding: [0x06,0xbf]
@ CHECK: movseq.w r1, #12 @ encoding: [0x5f,0xf0,0x0c,0x01]
@ CHECK: moveq r1, #12 @ encoding: [0x0c,0x21]
@ CHECK: movne.w r1, #12 @ encoding: [0x4f,0xf0,0x0c,0x01]
@ CHECK: mov.w r6, #450 @ encoding: [0x4f,0xf4,0xe1,0x76]
@ CHECK: it lo @ encoding: [0x38,0xbf]
@ CHECK: movlo.w r1, #-1 @ encoding: [0x4f,0xf0,0xff,0x31]
@ CHECK: mvn r3, #2 @ encoding: [0x6f,0xf0,0x02,0x03]
@ CHECK: movw r11, #43981 @ encoding: [0x4a,0xf6,0xcd,0x3b]
@ CHECK: movs r0, #1 @ encoding: [0x01,0x20]
@ CHECK: it ne @ encoding: [0x18,0xbf]
@ CHECK: movne r3, #15 @ encoding: [0x0f,0x23]
@ CHECK: itt eq @ encoding: [0x04,0xbf]
@ CHECK: moveq r0, #255 @ encoding: [0xff,0x20]
@ CHECK: movweq r1, #256 @ encoding: [0x40,0xf2,0x00,0x11]
@------------------------------------------------------------------------------
@ MOV(shifted register)
@------------------------------------------------------------------------------
mov r6, r2, lsl #16
mov.w r6, r2, lsl #16
mov r6, r2, lsr #16
mov.w r6, r2, lsr #16
movs r6, r2, asr #32
movs.w r6, r2, asr #32
movs r6, r2, ror #5
movs.w r6, r2, ror #5
movs r4, r4, lsl r5
movs.w r4, r4, lsl r5
movs r4, r4, lsr r5
movs.w r4, r4, lsr r5
movs r4, r4, asr r5
movs.w r4, r4, asr r5
movs r4, r4, ror r5
movs.w r4, r4, ror r5
mov r4, r4, lsl r5
movs r4, r4, ror r8
movs r4, r5, lsr r6
itttt eq
moveq r4, r4, lsl r5
moveq r4, r4, lsr r5
moveq r4, r4, asr r5
moveq r4, r4, ror r5
mov r4, r4, rrx
@ CHECK: lsl.w r6, r2, #16 @ encoding: [0x4f,0xea,0x02,0x46]
@ CHECK: lsl.w r6, r2, #16 @ encoding: [0x4f,0xea,0x02,0x46]
@ CHECK: lsr.w r6, r2, #16 @ encoding: [0x4f,0xea,0x12,0x46]
@ CHECK: lsr.w r6, r2, #16 @ encoding: [0x4f,0xea,0x12,0x46]
@ CHECK: asrs r6, r2, #32 @ encoding: [0x16,0x10]
@ CHECK: asrs.w r6, r2, #32 @ encoding: [0x5f,0xea,0x22,0x06]
@ CHECK: rors.w r6, r2, #5 @ encoding: [0x5f,0xea,0x72,0x16]
@ CHECK: rors.w r6, r2, #5 @ encoding: [0x5f,0xea,0x72,0x16]
@ CHECK: lsls r4, r5 @ encoding: [0xac,0x40]
@ CHECK: lsls.w r4, r4, r5 @ encoding: [0x14,0xfa,0x05,0xf4]
@ CHECK: lsrs r4, r5 @ encoding: [0xec,0x40]
@ CHECK: lsrs.w r4, r4, r5 @ encoding: [0x34,0xfa,0x05,0xf4]
@ CHECK: asrs r4, r5 @ encoding: [0x2c,0x41]
@ CHECK: asrs.w r4, r4, r5 @ encoding: [0x54,0xfa,0x05,0xf4]
@ CHECK: rors r4, r5 @ encoding: [0xec,0x41]
@ CHECK: rors.w r4, r4, r5 @ encoding: [0x74,0xfa,0x05,0xf4]
@ CHECK: lsl.w r4, r4, r5 @ encoding: [0x04,0xfa,0x05,0xf4]
@ CHECK: rors.w r4, r4, r8 @ encoding: [0x74,0xfa,0x08,0xf4]
@ CHECK: lsrs.w r4, r5, r6 @ encoding: [0x35,0xfa,0x06,0xf4]
@ CHECK: itttt eq @ encoding: [0x01,0xbf]
@ CHECK: lsleq r4, r5 @ encoding: [0xac,0x40]
@ CHECK: lsreq r4, r5 @ encoding: [0xec,0x40]
@ CHECK: asreq r4, r5 @ encoding: [0x2c,0x41]
@ CHECK: roreq r4, r5 @ encoding: [0xec,0x41]
@ CHECK: rrx r4, r4 @ encoding: [0x4f,0xea,0x34,0x04]
@------------------------------------------------------------------------------
@ MOVT
@------------------------------------------------------------------------------
movt r3, #7
movt r6, #0xffff
it eq
movteq r4, #0xff0
@ CHECK: movt r3, #7 @ encoding: [0xc0,0xf2,0x07,0x03]
@ CHECK: movt r6, #65535 @ encoding: [0xcf,0xf6,0xff,0x76]
@ CHECK: it eq @ encoding: [0x08,0xbf]
@ CHECK: movteq r4, #4080 @ encoding: [0xc0,0xf6,0xf0,0x74]
@------------------------------------------------------------------------------
@ MRC/MRC2
@------------------------------------------------------------------------------
mrc p14, #0, r1, c1, c2, #4
mrc p15, #7, apsr_nzcv, c15, c6, #6
mrc p9, #1, r1, c2, c2
mrc2 p12, #3, r3, c3, c4
mrc2 p14, #0, r1, c1, c2, #4
mrc2 p8, #7, apsr_nzcv, c15, c0, #1
MRC P14, #0, R1, C1, C2, #4
MRC P15, #7, APSR_NZCV, C15, C6, #6
MRC P9, #1, R1, C2, C2
MRC2 P12, #3, R3, C3, C4
MRC2 P14, #0, R1, C1, C2, #4
MRC2 P8, #7, APSR_NZCV, C15, C0, #1
@ CHECK: mrc p14, #0, r1, c1, c2, #4 @ encoding: [0x11,0xee,0x92,0x1e]
@ CHECK: mrc p15, #7, apsr_nzcv, c15, c6, #6 @ encoding: [0xff,0xee,0xd6,0xff]
@ CHECK: mrc p9, #1, r1, c2, c2, #0 @ encoding: [0x32,0xee,0x12,0x19]
@ CHECK: mrc2 p12, #3, r3, c3, c4, #0 @ encoding: [0x73,0xfe,0x14,0x3c]
@ CHECK: mrc2 p14, #0, r1, c1, c2, #4 @ encoding: [0x11,0xfe,0x92,0x1e]
@ CHECK: mrc2 p8, #7, apsr_nzcv, c15, c0, #1 @ encoding: [0xff,0xfe,0x30,0xf8]
@ CHECK: mrc p14, #0, r1, c1, c2, #4 @ encoding: [0x11,0xee,0x92,0x1e]
@ CHECK: mrc p15, #7, apsr_nzcv, c15, c6, #6 @ encoding: [0xff,0xee,0xd6,0xff]
@ CHECK: mrc p9, #1, r1, c2, c2, #0 @ encoding: [0x32,0xee,0x12,0x19]
@ CHECK: mrc2 p12, #3, r3, c3, c4, #0 @ encoding: [0x73,0xfe,0x14,0x3c]
@ CHECK: mrc2 p14, #0, r1, c1, c2, #4 @ encoding: [0x11,0xfe,0x92,0x1e]
@ CHECK: mrc2 p8, #7, apsr_nzcv, c15, c0, #1 @ encoding: [0xff,0xfe,0x30,0xf8]
@------------------------------------------------------------------------------
@ MRRC/MRRC2
@------------------------------------------------------------------------------
mrrc p7, #1, r5, r4, c1
mrrc2 p7, #1, r5, r4, c1
MRRC P7, #1, R5, R4, C1
MRRC2 P7, #1, R5, R4, C1
@ CHECK: mrrc p7, #1, r5, r4, c1 @ encoding: [0x54,0xec,0x11,0x57]
@ CHECK: mrrc2 p7, #1, r5, r4, c1 @ encoding: [0x54,0xfc,0x11,0x57]
@ CHECK: mrrc p7, #1, r5, r4, c1 @ encoding: [0x54,0xec,0x11,0x57]
@ CHECK: mrrc2 p7, #1, r5, r4, c1 @ encoding: [0x54,0xfc,0x11,0x57]
@------------------------------------------------------------------------------
@ MRS
@------------------------------------------------------------------------------
mrs r8, apsr
mrs r8, cpsr
mrs r8, spsr
@ CHECK: mrs r8, apsr @ encoding: [0xef,0xf3,0x00,0x88]
@ CHECK: mrs r8, apsr @ encoding: [0xef,0xf3,0x00,0x88]
@ CHECK: mrs r8, spsr @ encoding: [0xff,0xf3,0x00,0x88]
@------------------------------------------------------------------------------
@ MSR
@------------------------------------------------------------------------------
msr apsr, r1
msr apsr_g, r2
msr apsr_nzcvq, r3
msr APSR_nzcvq, r4
msr apsr_nzcvqg, r5
msr cpsr_fc, r6
msr cpsr_c, r7
msr cpsr_x, r8
msr cpsr_fc, r9
msr cpsr_all, r11
msr cpsr_fsx, r12
msr spsr_fc, r0
msr SPSR_fsxc, r5
msr cpsr_fsxc, r8
msr cpsr, r3
@ CHECK: msr APSR_nzcvq, r1 @ encoding: [0x81,0xf3,0x00,0x88]
@ CHECK: msr APSR_g, r2 @ encoding: [0x82,0xf3,0x00,0x84]
@ CHECK: msr APSR_nzcvq, r3 @ encoding: [0x83,0xf3,0x00,0x88]
@ CHECK: msr APSR_nzcvq, r4 @ encoding: [0x84,0xf3,0x00,0x88]
@ CHECK: msr APSR_nzcvqg, r5 @ encoding: [0x85,0xf3,0x00,0x8c]
@ CHECK: msr CPSR_fc, r6 @ encoding: [0x86,0xf3,0x00,0x89]
@ CHECK: msr CPSR_c, r7 @ encoding: [0x87,0xf3,0x00,0x81]
@ CHECK: msr CPSR_x, r8 @ encoding: [0x88,0xf3,0x00,0x82]
@ CHECK: msr CPSR_fc, r9 @ encoding: [0x89,0xf3,0x00,0x89]
@ CHECK: msr CPSR_fc, r11 @ encoding: [0x8b,0xf3,0x00,0x89]
@ CHECK: msr CPSR_fsx, r12 @ encoding: [0x8c,0xf3,0x00,0x8e]
@ CHECK: msr SPSR_fc, r0 @ encoding: [0x90,0xf3,0x00,0x89]
@ CHECK: msr SPSR_fsxc, r5 @ encoding: [0x95,0xf3,0x00,0x8f]
@ CHECK: msr CPSR_fsxc, r8 @ encoding: [0x88,0xf3,0x00,0x8f]
@ CHECK: msr CPSR_fc, r3 @ encoding: [0x83,0xf3,0x00,0x89]
@------------------------------------------------------------------------------
@ MUL
@------------------------------------------------------------------------------
muls r3, r4, r3
mul r3, r4, r3
mul r3, r4, r6
it eq
muleq r3, r4, r5
it le
mulle r4, r4, r8
mul r5, r6
@ CHECK: muls r3, r4, r3 @ encoding: [0x63,0x43]
@ CHECK: mul r3, r4, r3 @ encoding: [0x04,0xfb,0x03,0xf3]
@ CHECK: mul r3, r4, r6 @ encoding: [0x04,0xfb,0x06,0xf3]
@ CHECK: it eq @ encoding: [0x08,0xbf]
@ CHECK: muleq r3, r4, r5 @ encoding: [0x04,0xfb,0x05,0xf3]
@ CHECK: it le @ encoding: [0xd8,0xbf]
@ CHECK: mulle r4, r4, r8 @ encoding: [0x04,0xfb,0x08,0xf4]
@ CHECK: mul r5, r6, r5 @ encoding: [0x06,0xfb,0x05,0xf5]
@------------------------------------------------------------------------------
@ MVN(immediate)
@------------------------------------------------------------------------------
mvns r8, #21
mvn r0, #0x3fc0000
mvns r0, #0x3fc0000
itte eq
mvnseq r1, #12
mvneq.w r1, #12
mvnne r1, #12
@ CHECK: mvns r8, #21 @ encoding: [0x7f,0xf0,0x15,0x08]
@ CHECK: mvn r0, #66846720 @ encoding: [0x6f,0xf0,0x7f,0x70]
@ CHECK: mvns r0, #66846720 @ encoding: [0x7f,0xf0,0x7f,0x70]
@ CHECK: itte eq @ encoding: [0x06,0xbf]
@ CHECK: mvnseq r1, #12 @ encoding: [0x7f,0xf0,0x0c,0x01]
@ CHECK: mvneq r1, #12 @ encoding: [0x6f,0xf0,0x0c,0x01]
@ CHECK: mvnne r1, #12 @ encoding: [0x6f,0xf0,0x0c,0x01]
@------------------------------------------------------------------------------
@ MVN(register)
@------------------------------------------------------------------------------
mvn r2, r3
mvns r2, r3
mvn r5, r6, lsl #19
mvn r5, r6, lsr #9
mvn.w r5, r6, asr #4
mvn r5, r6, ror #6
mvn r5, r6, rrx
it eq
mvneq r2, r3
@ CHECK: mvn.w r2, r3 @ encoding: [0x6f,0xea,0x03,0x02]
@ CHECK: mvns r2, r3 @ encoding: [0xda,0x43]
@ CHECK: mvn.w r5, r6, lsl #19 @ encoding: [0x6f,0xea,0xc6,0x45]
@ CHECK: mvn.w r5, r6, lsr #9 @ encoding: [0x6f,0xea,0x56,0x25]
@ CHECK: mvn.w r5, r6, asr #4 @ encoding: [0x6f,0xea,0x26,0x15]
@ CHECK: mvn.w r5, r6, ror #6 @ encoding: [0x6f,0xea,0xb6,0x15]
@ CHECK: mvn.w r5, r6, rrx @ encoding: [0x6f,0xea,0x36,0x05]
@ CHECK: it eq @ encoding: [0x08,0xbf]
@ CHECK: mvneq r2, r3 @ encoding: [0xda,0x43]
@------------------------------------------------------------------------------
@ NEG
@------------------------------------------------------------------------------
neg r5, r2
neg r5, r8
@ CHECK: rsb.w r5, r2, #0 @ encoding: [0xc2,0xf1,0x00,0x05]
@ CHECK: rsb.w r5, r8, #0 @ encoding: [0xc8,0xf1,0x00,0x05]
@------------------------------------------------------------------------------
@ NOP
@------------------------------------------------------------------------------
nop.w
@ CHECK: nop.w @ encoding: [0xaf,0xf3,0x00,0x80]
@------------------------------------------------------------------------------
@ ORN
@------------------------------------------------------------------------------
orn r4, r5, #0xf000
orn.w r4, r5, #0xf000
orn r4, r5, r6
orn.w r4, r5, r6
orns r4, r5, r6
orns.w r4, r5, r6
orn r4, r5, r6, lsl #5
orn.w r4, r5, r6, lsl #5
orns r4, r5, r6, lsr #5
orn r4, r5, r6, lsr #5
orns r4, r5, r6, asr #5
orn r4, r5, r6, ror #5
@ CHECK: orn r4, r5, #61440 @ encoding: [0x65,0xf4,0x70,0x44]
@ CHECK: orn r4, r5, #61440 @ encoding: [0x65,0xf4,0x70,0x44]
@ CHECK: orn r4, r5, r6 @ encoding: [0x65,0xea,0x06,0x04]
@ CHECK: orn r4, r5, r6 @ encoding: [0x65,0xea,0x06,0x04]
@ CHECK: orns r4, r5, r6 @ encoding: [0x75,0xea,0x06,0x04]
@ CHECK: orns r4, r5, r6 @ encoding: [0x75,0xea,0x06,0x04]
@ CHECK: orn r4, r5, r6, lsl #5 @ encoding: [0x65,0xea,0x46,0x14]
@ CHECK: orn r4, r5, r6, lsl #5 @ encoding: [0x65,0xea,0x46,0x14]
@ CHECK: orns r4, r5, r6, lsr #5 @ encoding: [0x75,0xea,0x56,0x14]
@ CHECK: orn r4, r5, r6, lsr #5 @ encoding: [0x65,0xea,0x56,0x14]
@ CHECK: orns r4, r5, r6, asr #5 @ encoding: [0x75,0xea,0x66,0x14]
@ CHECK: orn r4, r5, r6, ror #5 @ encoding: [0x65,0xea,0x76,0x14]
@------------------------------------------------------------------------------
@ ORR
@------------------------------------------------------------------------------
orr r4, r5, #0xf000
orr r4, r5, r6
orr r4, r5, r6, lsl #5
orrs r4, r5, r6, lsr #5
orr r4, r5, r6, lsr #5
orrs r4, r5, r6, asr #5
orr r4, r5, r6, ror #5
@ CHECK: orr r4, r5, #61440 @ encoding: [0x45,0xf4,0x70,0x44]
@ CHECK: orr.w r4, r5, r6 @ encoding: [0x45,0xea,0x06,0x04]
@ CHECK: orr.w r4, r5, r6, lsl #5 @ encoding: [0x45,0xea,0x46,0x14]
@ CHECK: orrs.w r4, r5, r6, lsr #5 @ encoding: [0x55,0xea,0x56,0x14]
@ CHECK: orr.w r4, r5, r6, lsr #5 @ encoding: [0x45,0xea,0x56,0x14]
@ CHECK: orrs.w r4, r5, r6, asr #5 @ encoding: [0x55,0xea,0x66,0x14]
@ CHECK: orr.w r4, r5, r6, ror #5 @ encoding: [0x45,0xea,0x76,0x14]
@------------------------------------------------------------------------------
@ PKH
@------------------------------------------------------------------------------
pkhbt r2, r2, r3
pkhbt r2, r2, r3, lsl #31
pkhbt r2, r2, r3, lsl #0
pkhbt r2, r2, r3, lsl #15
pkhtb r2, r2, r3
pkhtb r2, r2, r3, asr #31
pkhtb r2, r2, r3, asr #15
@ CHECK: pkhbt r2, r2, r3 @ encoding: [0xc2,0xea,0x03,0x02]
@ CHECK: pkhbt r2, r2, r3, lsl #31 @ encoding: [0xc2,0xea,0xc3,0x72]
@ CHECK: pkhbt r2, r2, r3 @ encoding: [0xc2,0xea,0x03,0x02]
@ CHECK: pkhbt r2, r2, r3, lsl #15 @ encoding: [0xc2,0xea,0xc3,0x32]
@ CHECK: pkhbt r2, r3, r2 @ encoding: [0xc3,0xea,0x02,0x02]
@ CHECK: pkhtb r2, r2, r3, asr #31 @ encoding: [0xc2,0xea,0xe3,0x72]
@ CHECK: pkhtb r2, r2, r3, asr #15 @ encoding: [0xc2,0xea,0xe3,0x32]
@------------------------------------------------------------------------------
@ PLD(immediate)
@------------------------------------------------------------------------------
pld [r5, #-4]
pld [r6, #32]
pld [r6, #33]
pld [r6, #257]
pld [r7, #257]
pld [r1, #0]
pld [r1, #-0]
pld.w [r1, #-0]
@ CHECK: pld [r5, #-4] @ encoding: [0x15,0xf8,0x04,0xfc]
@ CHECK: pld [r6, #32] @ encoding: [0x96,0xf8,0x20,0xf0]
@ CHECK: pld [r6, #33] @ encoding: [0x96,0xf8,0x21,0xf0]
@ CHECK: pld [r6, #257] @ encoding: [0x96,0xf8,0x01,0xf1]
@ CHECK: pld [r7, #257] @ encoding: [0x97,0xf8,0x01,0xf1]
@ CHECK: pld [r1] @ encoding: [0x91,0xf8,0x00,0xf0]
@ CHECK: pld [r1, #-0] @ encoding: [0x11,0xf8,0x00,0xfc]
@ CHECK: pld [r1, #-0] @ encoding: [0x11,0xf8,0x00,0xfc]
@------------------------------------------------------------------------------
@ PLD(literal)
@------------------------------------------------------------------------------
@ pld _foo
@ FIXME: pld _foo @ encoding: [0x9f'A',0xf8'A',A,0xf0'A']
@ fixup A - offset: 0, value: _foo, kind: fixup_t2_ldst_pcrel_12
pld [pc,#-4095]
pld.w [pc,#-4095]
@ CHECK: pld [pc, #-4095] @ encoding: [0x1f,0xf8,0xff,0xff]
@ CHECK: pld [pc, #-4095] @ encoding: [0x1f,0xf8,0xff,0xff]
@------------------------------------------------------------------------------
@ PLD(register)
@------------------------------------------------------------------------------
pld [r8, r1]
pld [r5, r2]
pld.w [r5, r2]
pld [r0, r2, lsl #3]
pld [r8, r2, lsl #2]
pld [sp, r2, lsl #1]
pld [sp, r2, lsl #0]
pld.w [sp, r2, lsl #1]
@ CHECK: pld [r8, r1] @ encoding: [0x18,0xf8,0x01,0xf0]
@ CHECK: pld [r5, r2] @ encoding: [0x15,0xf8,0x02,0xf0]
@ CHECK: pld [r5, r2] @ encoding: [0x15,0xf8,0x02,0xf0]
@ CHECK: pld [r0, r2, lsl #3] @ encoding: [0x10,0xf8,0x32,0xf0]
@ CHECK: pld [r8, r2, lsl #2] @ encoding: [0x18,0xf8,0x22,0xf0]
@ CHECK: pld [sp, r2, lsl #1] @ encoding: [0x1d,0xf8,0x12,0xf0]
@ CHECK: pld [sp, r2] @ encoding: [0x1d,0xf8,0x02,0xf0]
@ CHECK: pld [sp, r2, lsl #1] @ encoding: [0x1d,0xf8,0x12,0xf0]
@------------------------------------------------------------------------------
@ PLI(immediate)
@------------------------------------------------------------------------------
pli [r5, #-4]
pli [r6, #32]
pli [r6, #33]
pli [r6, #257]
pli [r7, #257]
pli [pc, #+4095]
pli [pc, #-4095]
pli.w [pc, #-4095]
@ CHECK: pli [r5, #-4] @ encoding: [0x15,0xf9,0x04,0xfc]
@ CHECK: pli [r6, #32] @ encoding: [0x96,0xf9,0x20,0xf0]
@ CHECK: pli [r6, #33] @ encoding: [0x96,0xf9,0x21,0xf0]
@ CHECK: pli [r6, #257] @ encoding: [0x96,0xf9,0x01,0xf1]
@ CHECK: pli [r7, #257] @ encoding: [0x97,0xf9,0x01,0xf1]
@ CHECK: pli [pc, #4095] @ encoding: [0x9f,0xf9,0xff,0xff]
@ CHECK: pli [pc, #-4095] @ encoding: [0x1f,0xf9,0xff,0xff]
@ CHECK: pli [pc, #-4095] @ encoding: [0x1f,0xf9,0xff,0xff]
@------------------------------------------------------------------------------
@ PLI(literal)
@------------------------------------------------------------------------------
@ pli _foo
@ FIXME: pli _foo @ encoding: [0x9f'A',0xf9'A',A,0xf0'A']
@ fixup A - offset: 0, value: _foo, kind: fixup_t2_ldst_pcrel_12
@------------------------------------------------------------------------------
@ PLI(register)
@------------------------------------------------------------------------------
pli [r8, r1]
pli [r5, r2]
pli.w [r5, r2]
pli [r0, r2, lsl #3]
pli [r8, r2, lsl #2]
pli [sp, r2, lsl #1]
pli [sp, r2, lsl #0]
pli.w [sp, r2, lsl #1]
@ CHECK: pli [r8, r1] @ encoding: [0x18,0xf9,0x01,0xf0]
@ CHECK: pli [r5, r2] @ encoding: [0x15,0xf9,0x02,0xf0]
@ CHECK: pli [r5, r2] @ encoding: [0x15,0xf9,0x02,0xf0]
@ CHECK: pli [r0, r2, lsl #3] @ encoding: [0x10,0xf9,0x32,0xf0]
@ CHECK: pli [r8, r2, lsl #2] @ encoding: [0x18,0xf9,0x22,0xf0]
@ CHECK: pli [sp, r2, lsl #1] @ encoding: [0x1d,0xf9,0x12,0xf0]
@ CHECK: pli [sp, r2] @ encoding: [0x1d,0xf9,0x02,0xf0]
@ CHECK: pli [sp, r2, lsl #1] @ encoding: [0x1d,0xf9,0x12,0xf0]
@------------------------------------------------------------------------------
@ POP (alias)
@------------------------------------------------------------------------------
pop {r2, r9}
@ CHECK: pop.w {r2, r9} @ encoding: [0xbd,0xe8,0x04,0x02]
@------------------------------------------------------------------------------
@ PUSH (alias)
@------------------------------------------------------------------------------
push {r2, r9}
@ CHECK: push.w {r2, r9} @ encoding: [0x2d,0xe9,0x04,0x02]
@------------------------------------------------------------------------------
@ QADD/QADD16/QADD8
@------------------------------------------------------------------------------
qadd r1, r2, r3
qadd16 r1, r2, r3
qadd8 r1, r2, r3
itte gt
qaddgt r1, r2, r3
qadd16gt r1, r2, r3
qadd8le r1, r2, r3
@ CHECK: qadd r1, r2, r3 @ encoding: [0x83,0xfa,0x82,0xf1]
@ CHECK: qadd16 r1, r2, r3 @ encoding: [0x92,0xfa,0x13,0xf1]
@ CHECK: qadd8 r1, r2, r3 @ encoding: [0x82,0xfa,0x13,0xf1]
@ CHECK: itte gt @ encoding: [0xc6,0xbf]
@ CHECK: qaddgt r1, r2, r3 @ encoding: [0x83,0xfa,0x82,0xf1]
@ CHECK: qadd16gt r1, r2, r3 @ encoding: [0x92,0xfa,0x13,0xf1]
@ CHECK: qadd8le r1, r2, r3 @ encoding: [0x82,0xfa,0x13,0xf1]
@------------------------------------------------------------------------------
@ QDADD/QDSUB
@------------------------------------------------------------------------------
qdadd r6, r7, r8
qdsub r6, r7, r8
itt hi
qdaddhi r6, r7, r8
qdsubhi r6, r7, r8
@ CHECK: qdadd r6, r7, r8 @ encoding: [0x88,0xfa,0x97,0xf6]
@ CHECK: qdsub r6, r7, r8 @ encoding: [0x88,0xfa,0xb7,0xf6]
@ CHECK: itt hi @ encoding: [0x84,0xbf]
@ CHECK: qdaddhi r6, r7, r8 @ encoding: [0x88,0xfa,0x97,0xf6]
@ CHECK: qdsubhi r6, r7, r8 @ encoding: [0x88,0xfa,0xb7,0xf6]
@------------------------------------------------------------------------------
@ QSAX
@------------------------------------------------------------------------------
qsax r9, r12, r0
it eq
qsaxeq r9, r12, r0
@ CHECK: qsax r9, r12, r0 @ encoding: [0xec,0xfa,0x10,0xf9]
@ CHECK: it eq @ encoding: [0x08,0xbf]
@ CHECK: qsaxeq r9, r12, r0 @ encoding: [0xec,0xfa,0x10,0xf9]
@------------------------------------------------------------------------------
@ QSUB/QSUB16/QSUB8
@------------------------------------------------------------------------------
qsub r1, r2, r3
qsub16 r1, r2, r3
qsub8 r1, r2, r3
itet le
qsuble r1, r2, r3
qsub16gt r1, r2, r3
qsub8le r1, r2, r3
@ CHECK: qsub r1, r2, r3 @ encoding: [0x83,0xfa,0xa2,0xf1]
@ CHECK: qsub16 r1, r2, r3 @ encoding: [0xd2,0xfa,0x13,0xf1]
@ CHECK: qsub8 r1, r2, r3 @ encoding: [0xc2,0xfa,0x13,0xf1]
@ CHECK: itet le @ encoding: [0xd6,0xbf]
@ CHECK: qsuble r1, r2, r3 @ encoding: [0x83,0xfa,0xa2,0xf1]
@ CHECK: qsub16gt r1, r2, r3 @ encoding: [0xd2,0xfa,0x13,0xf1]
@ CHECK: qsub8le r1, r2, r3 @ encoding: [0xc2,0xfa,0x13,0xf1]
@------------------------------------------------------------------------------
@ RBIT
@------------------------------------------------------------------------------
rbit r1, r2
it ne
rbitne r1, r2
@ CHECK: rbit r1, r2 @ encoding: [0x92,0xfa,0xa2,0xf1]
@ CHECK: it ne @ encoding: [0x18,0xbf]
@ CHECK: rbitne r1, r2 @ encoding: [0x92,0xfa,0xa2,0xf1]
@------------------------------------------------------------------------------
@ REV
@------------------------------------------------------------------------------
rev.w r1, r2
rev r2, r8
itt ne
revne r1, r2
revne r1, r8
@ CHECK: rev.w r1, r2 @ encoding: [0x92,0xfa,0x82,0xf1]
@ CHECK: rev.w r2, r8 @ encoding: [0x98,0xfa,0x88,0xf2]
@ CHECK: itt ne @ encoding: [0x1c,0xbf]
@ CHECK: revne r1, r2 @ encoding: [0x11,0xba]
@ CHECK: revne.w r1, r8 @ encoding: [0x98,0xfa,0x88,0xf1]
@------------------------------------------------------------------------------
@ REV16
@------------------------------------------------------------------------------
rev16.w r1, r2
rev16 r2, r8
itt ne
rev16ne r1, r2
rev16ne r1, r8
@ CHECK: rev16.w r1, r2 @ encoding: [0x92,0xfa,0x92,0xf1]
@ CHECK: rev16.w r2, r8 @ encoding: [0x98,0xfa,0x98,0xf2]
@ CHECK: itt ne @ encoding: [0x1c,0xbf]
@ CHECK: rev16ne r1, r2 @ encoding: [0x51,0xba]
@ CHECK: rev16ne.w r1, r8 @ encoding: [0x98,0xfa,0x98,0xf1]
@------------------------------------------------------------------------------
@ REVSH
@------------------------------------------------------------------------------
revsh.w r1, r2
revsh r2, r8
itt ne
revshne r1, r2
revshne r1, r8
@ CHECK: revsh.w r1, r2 @ encoding: [0x92,0xfa,0xb2,0xf1]
@ CHECK: revsh.w r2, r8 @ encoding: [0x98,0xfa,0xb8,0xf2]
@ CHECK: itt ne @ encoding: [0x1c,0xbf]
@ CHECK: revshne r1, r2 @ encoding: [0xd1,0xba]
@ CHECK: revshne.w r1, r8 @ encoding: [0x98,0xfa,0xb8,0xf1]
@------------------------------------------------------------------------------
@ ROR (immediate)
@------------------------------------------------------------------------------
ror r2, r3, #12
rors r8, r3, #31
rors.w r2, r3, #1
ror r2, r3, #4
rors r2, r12, #15
ror r3, #19
rors r8, #2
rors.w r7, #5
ror.w r12, #21
@ CHECK: ror.w r2, r3, #12 @ encoding: [0x4f,0xea,0x33,0x32]
@ CHECK: rors.w r8, r3, #31 @ encoding: [0x5f,0xea,0xf3,0x78]
@ CHECK: rors.w r2, r3, #1 @ encoding: [0x5f,0xea,0x73,0x02]
@ CHECK: ror.w r2, r3, #4 @ encoding: [0x4f,0xea,0x33,0x12]
@ CHECK: rors.w r2, r12, #15 @ encoding: [0x5f,0xea,0xfc,0x32]
@ CHECK: ror.w r3, r3, #19 @ encoding: [0x4f,0xea,0xf3,0x43]
@ CHECK: rors.w r8, r8, #2 @ encoding: [0x5f,0xea,0xb8,0x08]
@ CHECK: rors.w r7, r7, #5 @ encoding: [0x5f,0xea,0x77,0x17]
@ CHECK: ror.w r12, r12, #21 @ encoding: [0x4f,0xea,0x7c,0x5c]
@------------------------------------------------------------------------------
@ ROR (register)
@------------------------------------------------------------------------------
ror r3, r4, r2
ror.w r1, r2
rors r3, r4, r8
@ CHECK: ror.w r3, r4, r2 @ encoding: [0x64,0xfa,0x02,0xf3]
@ CHECK: ror.w r1, r1, r2 @ encoding: [0x61,0xfa,0x02,0xf1]
@ CHECK: rors.w r3, r4, r8 @ encoding: [0x74,0xfa,0x08,0xf3]
@------------------------------------------------------------------------------
@ RRX
@------------------------------------------------------------------------------
rrx r1, r2
rrxs r1, r2
ite lt
rrxlt r9, r12
rrxsge r8, r3
@ CHECK: rrx r1, r2 @ encoding: [0x4f,0xea,0x32,0x01]
@ CHECK: rrxs r1, r2 @ encoding: [0x5f,0xea,0x32,0x01]
@ CHECK: ite lt @ encoding: [0xb4,0xbf]
@ CHECK: rrxlt r9, r12 @ encoding: [0x4f,0xea,0x3c,0x09]
@ CHECK: rrxsge r8, r3 @ encoding: [0x5f,0xea,0x33,0x08]
@------------------------------------------------------------------------------
@ RSB (immediate)
@------------------------------------------------------------------------------
rsb r2, r5, #0xff000
rsbs r3, r12, #0xf
rsb r1, #0xff
rsb r1, r1, #0xff
rsb r11, r11, #0
rsb r9, #0
rsbs r3, r1, #0
rsb r3, r1, #0
@ CHECK: rsb.w r2, r5, #1044480 @ encoding: [0xc5,0xf5,0x7f,0x22]
@ CHECK: rsbs.w r3, r12, #15 @ encoding: [0xdc,0xf1,0x0f,0x03]
@ CHECK: rsb.w r1, r1, #255 @ encoding: [0xc1,0xf1,0xff,0x01]
@ CHECK: rsb.w r1, r1, #255 @ encoding: [0xc1,0xf1,0xff,0x01]
@ CHECK: rsb.w r11, r11, #0 @ encoding: [0xcb,0xf1,0x00,0x0b]
@ CHECK: rsb.w r9, r9, #0 @ encoding: [0xc9,0xf1,0x00,0x09]
@ CHECK: rsbs r3, r1, #0 @ encoding: [0x4b,0x42]
@ CHECK: rsb.w r3, r1, #0 @ encoding: [0xc1,0xf1,0x00,0x03]
@------------------------------------------------------------------------------
@ RSB (register)
@------------------------------------------------------------------------------
rsb r4, r8
rsb.w r4, r8
rsb r4, r9, r8
rsb.w r4, r9, r8
rsb r1, r4, r8, asr #3
rsb.w r1, r4, r8, asr #3
rsbs r2, r1, r7, lsl #1
rsbs.w r2, r1, r7, lsl #1
rsbs r0, r1, r2
rsbs.w r0, r1, r2
@ CHECK: rsb r4, r4, r8 @ encoding: [0xc4,0xeb,0x08,0x04]
@ CHECK: rsb r4, r4, r8 @ encoding: [0xc4,0xeb,0x08,0x04]
@ CHECK: rsb r4, r9, r8 @ encoding: [0xc9,0xeb,0x08,0x04]
@ CHECK: rsb r4, r9, r8 @ encoding: [0xc9,0xeb,0x08,0x04]
@ CHECK: rsb r1, r4, r8, asr #3 @ encoding: [0xc4,0xeb,0xe8,0x01]
@ CHECK: rsb r1, r4, r8, asr #3 @ encoding: [0xc4,0xeb,0xe8,0x01]
@ CHECK: rsbs r2, r1, r7, lsl #1 @ encoding: [0xd1,0xeb,0x47,0x02]
@ CHECK: rsbs r2, r1, r7, lsl #1 @ encoding: [0xd1,0xeb,0x47,0x02]
@ CHECK: rsbs r0, r1, r2 @ encoding: [0xd1,0xeb,0x02,0x00]
@ CHECK: rsbs r0, r1, r2 @ encoding: [0xd1,0xeb,0x02,0x00]
@------------------------------------------------------------------------------
@ SADD16
@------------------------------------------------------------------------------
sadd16 r3, r4, r8
it ne
sadd16ne r3, r4, r8
@ CHECK: sadd16 r3, r4, r8 @ encoding: [0x94,0xfa,0x08,0xf3]
@ CHECK: it ne @ encoding: [0x18,0xbf]
@ CHECK: sadd16ne r3, r4, r8 @ encoding: [0x94,0xfa,0x08,0xf3]
@------------------------------------------------------------------------------
@ SADD8
@------------------------------------------------------------------------------
sadd8 r3, r4, r8
it ne
sadd8ne r3, r4, r8
@ CHECK: sadd8 r3, r4, r8 @ encoding: [0x84,0xfa,0x08,0xf3]
@ CHECK: it ne @ encoding: [0x18,0xbf]
@ CHECK: sadd8ne r3, r4, r8 @ encoding: [0x84,0xfa,0x08,0xf3]
@------------------------------------------------------------------------------
@ SASX
@------------------------------------------------------------------------------
saddsubx r9, r2, r7
it ne
saddsubxne r2, r5, r6
sasx r9, r2, r7
it ne
sasxne r2, r5, r6
@ CHECK: sasx r9, r2, r7 @ encoding: [0xa2,0xfa,0x07,0xf9]
@ CHECK: it ne @ encoding: [0x18,0xbf]
@ CHECK: sasxne r2, r5, r6 @ encoding: [0xa5,0xfa,0x06,0xf2]
@ CHECK: sasx r9, r2, r7 @ encoding: [0xa2,0xfa,0x07,0xf9]
@ CHECK: it ne @ encoding: [0x18,0xbf]
@ CHECK: sasxne r2, r5, r6 @ encoding: [0xa5,0xfa,0x06,0xf2]
@------------------------------------------------------------------------------
@ SBC (immediate)
@------------------------------------------------------------------------------
sbc r0, r1, #4
sbcs r0, r1, #0
sbc r1, r2, #255
sbc r3, r7, #0x00550055
sbc r8, r12, #0xaa00aa00
sbc r9, r7, #0xa5a5a5a5
sbc r5, r3, #0x87000000
sbc r4, r2, #0x7f800000
sbc r4, r2, #0x00000680
@ CHECK: sbc r0, r1, #4 @ encoding: [0x61,0xf1,0x04,0x00]
@ CHECK: sbcs r0, r1, #0 @ encoding: [0x71,0xf1,0x00,0x00]
@ CHECK: sbc r1, r2, #255 @ encoding: [0x62,0xf1,0xff,0x01]
@ CHECK: sbc r3, r7, #5570645 @ encoding: [0x67,0xf1,0x55,0x13]
@ CHECK: sbc r8, r12, #2852170240 @ encoding: [0x6c,0xf1,0xaa,0x28]
@ CHECK: sbc r9, r7, #2779096485 @ encoding: [0x67,0xf1,0xa5,0x39]
@ CHECK: sbc r5, r3, #2264924160 @ encoding: [0x63,0xf1,0x07,0x45]
@ CHECK: sbc r4, r2, #2139095040 @ encoding: [0x62,0xf1,0xff,0x44]
@ CHECK: sbc r4, r2, #1664 @ encoding: [0x62,0xf5,0xd0,0x64]
@------------------------------------------------------------------------------
@ SBC (register)
@------------------------------------------------------------------------------
sbc r4, r5, r6
sbcs r4, r5, r6
sbc.w r9, r1, r3
sbcs.w r9, r1, r3
sbc r0, r1, r3, ror #4
sbcs r0, r1, r3, lsl #7
sbc.w r0, r1, r3, lsr #31
sbcs.w r0, r1, r3, asr #32
@ CHECK: sbc.w r4, r5, r6 @ encoding: [0x65,0xeb,0x06,0x04]
@ CHECK: sbcs.w r4, r5, r6 @ encoding: [0x75,0xeb,0x06,0x04]
@ CHECK: sbc.w r9, r1, r3 @ encoding: [0x61,0xeb,0x03,0x09]
@ CHECK: sbcs.w r9, r1, r3 @ encoding: [0x71,0xeb,0x03,0x09]
@ CHECK: sbc.w r0, r1, r3, ror #4 @ encoding: [0x61,0xeb,0x33,0x10]
@ CHECK: sbcs.w r0, r1, r3, lsl #7 @ encoding: [0x71,0xeb,0xc3,0x10]
@ CHECK: sbc.w r0, r1, r3, lsr #31 @ encoding: [0x61,0xeb,0xd3,0x70]
@ CHECK: sbcs.w r0, r1, r3, asr #32 @ encoding: [0x71,0xeb,0x23,0x00]
@------------------------------------------------------------------------------
@ SBFX
@------------------------------------------------------------------------------
sbfx r4, r5, #16, #1
it gt
sbfxgt r4, r5, #16, #16
@ CHECK: sbfx r4, r5, #16, #1 @ encoding: [0x45,0xf3,0x00,0x44]
@ CHECK: it gt @ encoding: [0xc8,0xbf]
@ CHECK: sbfxgt r4, r5, #16, #16 @ encoding: [0x45,0xf3,0x0f,0x44]
@------------------------------------------------------------------------------
@ SEL
@------------------------------------------------------------------------------
sel r5, r9, r2
it le
selle r5, r9, r2
@ CHECK: sel r5, r9, r2 @ encoding: [0xa9,0xfa,0x82,0xf5]
@ CHECK: it le @ encoding: [0xd8,0xbf]
@ CHECK: selle r5, r9, r2 @ encoding: [0xa9,0xfa,0x82,0xf5]
@------------------------------------------------------------------------------
@ SEV
@------------------------------------------------------------------------------
sev.w
it eq
seveq.w
@ CHECK: sev.w @ encoding: [0xaf,0xf3,0x04,0x80]
@ CHECK: it eq @ encoding: [0x08,0xbf]
@ CHECK: seveq.w @ encoding: [0xaf,0xf3,0x04,0x80]
@------------------------------------------------------------------------------
@ SADD16/SADD8
@------------------------------------------------------------------------------
sadd16 r1, r2, r3
sadd8 r1, r2, r3
ite gt
sadd16gt r1, r2, r3
sadd8le r1, r2, r3
@ CHECK: sadd16 r1, r2, r3 @ encoding: [0x92,0xfa,0x03,0xf1]
@ CHECK: sadd8 r1, r2, r3 @ encoding: [0x82,0xfa,0x03,0xf1]
@ CHECK: ite gt @ encoding: [0xcc,0xbf]
@ CHECK: sadd16gt r1, r2, r3 @ encoding: [0x92,0xfa,0x03,0xf1]
@ CHECK: sadd8le r1, r2, r3 @ encoding: [0x82,0xfa,0x03,0xf1]
@------------------------------------------------------------------------------
@ SHASX
@------------------------------------------------------------------------------
shasx r4, r8, r2
it gt
shasxgt r4, r8, r2
shaddsubx r4, r8, r2
it gt
shaddsubxgt r4, r8, r2
@ CHECK: shasx r4, r8, r2 @ encoding: [0xa8,0xfa,0x22,0xf4]
@ CHECK: it gt @ encoding: [0xc8,0xbf]
@ CHECK: shasxgt r4, r8, r2 @ encoding: [0xa8,0xfa,0x22,0xf4]
@ CHECK: shasx r4, r8, r2 @ encoding: [0xa8,0xfa,0x22,0xf4]
@ CHECK: it gt @ encoding: [0xc8,0xbf]