1 ; RUN
: llvm-mc
-triple arm64-apple-darwin
-show-encoding
< %s | FileCheck
%s
5 ;
-----------------------------------------------------------------------------
6 ; Unconditional branch
(register
) instructions.
7 ;
-----------------------------------------------------------------------------
10 ; CHECK
: encoding
: [0xc0,0x03,0x5f,0xd6]
12 ; CHECK
: encoding
: [0x20,0x00,0x5f,0xd6]
14 ; CHECK
: encoding
: [0xe0,0x03,0xbf,0xd6]
16 ; CHECK
: encoding
: [0xe0,0x03,0x9f,0xd6]
18 ; CHECK
: encoding
: [0xa0,0x00,0x1f,0xd6]
20 ; CHECK
: encoding
: [0x20,0x01,0x3f,0xd6]
22 ; CHECK
: bl L1 ; encoding
: [A,A,A,0b100101AA
]
23 ; CHECK
: fixup
A - offset
: 0, value
: L1
, kind
: fixup_aarch64_pcrel_call26
25 ;
-----------------------------------------------------------------------------
26 ; Contitional branch instructions.
27 ;
-----------------------------------------------------------------------------
30 ; CHECK
: b L1 ; encoding
: [A,A,A,0b000101AA
]
31 ; CHECK
: fixup
A - offset
: 0, value
: L1
, kind
: fixup_aarch64_pcrel_branch26
33 ; CHECK
: b.eq L1 ; encoding
: [0bAAA00000
,A,A,0x54]
34 ; CHECK
: fixup
A - offset
: 0, value
: L1
, kind
: fixup_aarch64_pcrel_branch19
36 ; CHECK
: b.ne L1 ; encoding
: [0bAAA00001
,A,A,0x54]
37 ; CHECK
: fixup
A - offset
: 0, value
: L1
, kind
: fixup_aarch64_pcrel_branch19
39 ; CHECK
: b.hs L1 ; encoding
: [0bAAA00010
,A,A,0x54]
40 ; CHECK
: fixup
A - offset
: 0, value
: L1
, kind
: fixup_aarch64_pcrel_branch19
42 ; CHECK
: b.lo L1 ; encoding
: [0bAAA00011
,A,A,0x54]
43 ; CHECK
: fixup
A - offset
: 0, value
: L1
, kind
: fixup_aarch64_pcrel_branch19
45 ; CHECK
: b.mi L1 ; encoding
: [0bAAA00100
,A,A,0x54]
46 ; CHECK
: fixup
A - offset
: 0, value
: L1
, kind
: fixup_aarch64_pcrel_branch19
48 ; CHECK
: b.pl L1 ; encoding
: [0bAAA00101
,A,A,0x54]
49 ; CHECK
: fixup
A - offset
: 0, value
: L1
, kind
: fixup_aarch64_pcrel_branch19
51 ; CHECK
: b.vs L1 ; encoding
: [0bAAA00110
,A,A,0x54]
52 ; CHECK
: fixup
A - offset
: 0, value
: L1
, kind
: fixup_aarch64_pcrel_branch19
54 ; CHECK
: b.vc L1 ; encoding
: [0bAAA00111
,A,A,0x54]
55 ; CHECK
: fixup
A - offset
: 0, value
: L1
, kind
: fixup_aarch64_pcrel_branch19
57 ; CHECK
: b.hi L1 ; encoding
: [0bAAA01000
,A,A,0x54]
58 ; CHECK
: fixup
A - offset
: 0, value
: L1
, kind
: fixup_aarch64_pcrel_branch19
60 ; CHECK
: b.ls L1 ; encoding
: [0bAAA01001
,A,A,0x54]
61 ; CHECK
: fixup
A - offset
: 0, value
: L1
, kind
: fixup_aarch64_pcrel_branch19
63 ; CHECK
: b.ge L1 ; encoding
: [0bAAA01010
,A,A,0x54]
64 ; CHECK
: fixup
A - offset
: 0, value
: L1
, kind
: fixup_aarch64_pcrel_branch19
66 ; CHECK
: b.lt L1 ; encoding
: [0bAAA01011
,A,A,0x54]
67 ; CHECK
: fixup
A - offset
: 0, value
: L1
, kind
: fixup_aarch64_pcrel_branch19
69 ; CHECK
: b.gt L1 ; encoding
: [0bAAA01100
,A,A,0x54]
70 ; CHECK
: fixup
A - offset
: 0, value
: L1
, kind
: fixup_aarch64_pcrel_branch19
72 ; CHECK
: b.le L1 ; encoding
: [0bAAA01101
,A,A,0x54]
73 ; CHECK
: fixup
A - offset
: 0, value
: L1
, kind
: fixup_aarch64_pcrel_branch19
75 ; CHECK
: b.al L1 ; encoding
: [0bAAA01110
,A,A,0x54]
76 ; CHECK
: fixup
A - offset
: 0, value
: L1
, kind
: fixup_aarch64_pcrel_branch19
83 ; CHECK
: b.lo
#1048572 ; encoding: [0xe3,0xff,0x7f,0x54]
85 ; CHECK
: b #134217724 ; encoding: [0xff,0xff,0xff,0x15]
87 ; CHECK
: b #-134217728 ; encoding: [0x00,0x00,0x00,0x16]
89 ;
-----------------------------------------------------------------------------
90 ; Compare-and-branch instructions.
91 ;
-----------------------------------------------------------------------------
94 ; CHECK
: encoding
: [0bAAA00001
,A,A,0x34]
96 ; CHECK
: encoding
: [0bAAA00001
,A,A,0xb4]
98 ; CHECK
: encoding
: [0bAAA00010
,A,A,0x35]
100 ; CHECK
: encoding
: [0bAAA00010
,A,A,0xb5]
104 ; CHECK
: cbz w20
, #1048572 ; encoding: [0xf4,0xff,0x7f,0x34]
106 ; CHECK
: cbnz x2
, #-1048576 ; encoding: [0x02,0x00,0x80,0xb5]
109 ;
-----------------------------------------------------------------------------
110 ; Bit-test-and-branch instructions.
111 ;
-----------------------------------------------------------------------------
114 ; CHECK
: encoding
: [0bAAA00001
,A,0b00011AAA
,0x36]
116 ; CHECK
: encoding
: [0bAAA00001
,A,0b11111AAA
,0xb7]
119 ; CHECK
: encoding
: [0bAAA00001
,A,0b00011AAA
,0x36]
121 ; CHECK
: encoding
: [0bAAA00001
,A,0b11111AAA
,0x37]
124 ; CHECK
: tbz w1
, #3, #28
126 ; CHECK
: tbz w3
, #5, #32764 ; encoding: [0xe3,0xff,0x2b,0x36]
128 ; CHECK
: tbnz w3
, #8, #-32768 ; encoding: [0x03,0x00,0x44,0x37]
130 ;
-----------------------------------------------------------------------------
131 ; Exception generation instructions.
132 ;
-----------------------------------------------------------------------------
135 ; CHECK
: encoding
: [0x20,0x00,0x20,0xd4]
137 ; CHECK
: encoding
: [0x41,0x00,0xa0,0xd4]
139 ; CHECK
: encoding
: [0x62,0x00,0xa0,0xd4]
141 ; CHECK
: encoding
: [0x83,0x00,0xa0,0xd4]
143 ; CHECK
: encoding
: [0xa0,0x00,0x40,0xd4]
145 ; CHECK
: encoding
: [0xc2,0x00,0x00,0xd4]
147 ; CHECK
: encoding
: [0xe3,0x00,0x00,0xd4]
149 ; CHECK
: encoding
: [0x01,0x01,0x00,0xd4]
151 ; The immediate defaults to zero for DCPSn
156 ; CHECK
: dcps1 ; encoding
: [0x01,0x00,0xa0,0xd4]
157 ; CHECK
: dcps2 ; encoding
: [0x02,0x00,0xa0,0xd4]
158 ; CHECK
: dcps3 ; encoding
: [0x03,0x00,0xa0,0xd4]