• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %s \
2// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
3// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
4// RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
5// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
6// RUN:        | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST
7// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
8// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
9
10// ---------------------------------------------------------------------------//
11// Test vector form and aliases.
12// ---------------------------------------------------------------------------//
13
14incd    z0.d
15// CHECK-INST: incd    z0.d
16// CHECK-ENCODING: [0xe0,0xc3,0xf0,0x04]
17// CHECK-ERROR: instruction requires: sve
18// CHECK-UNKNOWN: e0 c3 f0 04 <unknown>
19
20incd    z0.d, all
21// CHECK-INST: incd    z0.d
22// CHECK-ENCODING: [0xe0,0xc3,0xf0,0x04]
23// CHECK-ERROR: instruction requires: sve
24// CHECK-UNKNOWN: e0 c3 f0 04 <unknown>
25
26incd    z0.d, all, mul #1
27// CHECK-INST: incd    z0.d
28// CHECK-ENCODING: [0xe0,0xc3,0xf0,0x04]
29// CHECK-ERROR: instruction requires: sve
30// CHECK-UNKNOWN: e0 c3 f0 04 <unknown>
31
32incd    z0.d, all, mul #16
33// CHECK-INST: incd    z0.d, all, mul #16
34// CHECK-ENCODING: [0xe0,0xc3,0xff,0x04]
35// CHECK-ERROR: instruction requires: sve
36// CHECK-UNKNOWN: e0 c3 ff 04 <unknown>
37
38
39// ---------------------------------------------------------------------------//
40// Test scalar form and aliases.
41// ---------------------------------------------------------------------------//
42
43incd    x0
44// CHECK-INST: incd    x0
45// CHECK-ENCODING: [0xe0,0xe3,0xf0,0x04]
46// CHECK-ERROR: instruction requires: sve
47// CHECK-UNKNOWN: e0 e3 f0 04 <unknown>
48
49incd    x0, all
50// CHECK-INST: incd    x0
51// CHECK-ENCODING: [0xe0,0xe3,0xf0,0x04]
52// CHECK-ERROR: instruction requires: sve
53// CHECK-UNKNOWN: e0 e3 f0 04 <unknown>
54
55incd    x0, all, mul #1
56// CHECK-INST: incd    x0
57// CHECK-ENCODING: [0xe0,0xe3,0xf0,0x04]
58// CHECK-ERROR: instruction requires: sve
59// CHECK-UNKNOWN: e0 e3 f0 04 <unknown>
60
61incd    x0, all, mul #16
62// CHECK-INST: incd    x0, all, mul #16
63// CHECK-ENCODING: [0xe0,0xe3,0xff,0x04]
64// CHECK-ERROR: instruction requires: sve
65// CHECK-UNKNOWN: e0 e3 ff 04 <unknown>
66
67
68// ---------------------------------------------------------------------------//
69// Test predicate patterns
70// ---------------------------------------------------------------------------//
71
72incd    x0, pow2
73// CHECK-INST: incd    x0, pow2
74// CHECK-ENCODING: [0x00,0xe0,0xf0,0x04]
75// CHECK-ERROR: instruction requires: sve
76// CHECK-UNKNOWN: 00 e0 f0 04 <unknown>
77
78incd    x0, vl1
79// CHECK-INST: incd    x0, vl1
80// CHECK-ENCODING: [0x20,0xe0,0xf0,0x04]
81// CHECK-ERROR: instruction requires: sve
82// CHECK-UNKNOWN: 20 e0 f0 04 <unknown>
83
84incd    x0, vl2
85// CHECK-INST: incd    x0, vl2
86// CHECK-ENCODING: [0x40,0xe0,0xf0,0x04]
87// CHECK-ERROR: instruction requires: sve
88// CHECK-UNKNOWN: 40 e0 f0 04 <unknown>
89
90incd    x0, vl3
91// CHECK-INST: incd    x0, vl3
92// CHECK-ENCODING: [0x60,0xe0,0xf0,0x04]
93// CHECK-ERROR: instruction requires: sve
94// CHECK-UNKNOWN: 60 e0 f0 04 <unknown>
95
96incd    x0, vl4
97// CHECK-INST: incd    x0, vl4
98// CHECK-ENCODING: [0x80,0xe0,0xf0,0x04]
99// CHECK-ERROR: instruction requires: sve
100// CHECK-UNKNOWN: 80 e0 f0 04 <unknown>
101
102incd    x0, vl5
103// CHECK-INST: incd    x0, vl5
104// CHECK-ENCODING: [0xa0,0xe0,0xf0,0x04]
105// CHECK-ERROR: instruction requires: sve
106// CHECK-UNKNOWN: a0 e0 f0 04 <unknown>
107
108incd    x0, vl6
109// CHECK-INST: incd    x0, vl6
110// CHECK-ENCODING: [0xc0,0xe0,0xf0,0x04]
111// CHECK-ERROR: instruction requires: sve
112// CHECK-UNKNOWN: c0 e0 f0 04 <unknown>
113
114incd    x0, vl7
115// CHECK-INST: incd    x0, vl7
116// CHECK-ENCODING: [0xe0,0xe0,0xf0,0x04]
117// CHECK-ERROR: instruction requires: sve
118// CHECK-UNKNOWN: e0 e0 f0 04 <unknown>
119
120incd    x0, vl8
121// CHECK-INST: incd    x0, vl8
122// CHECK-ENCODING: [0x00,0xe1,0xf0,0x04]
123// CHECK-ERROR: instruction requires: sve
124// CHECK-UNKNOWN: 00 e1 f0 04 <unknown>
125
126incd    x0, vl16
127// CHECK-INST: incd    x0, vl16
128// CHECK-ENCODING: [0x20,0xe1,0xf0,0x04]
129// CHECK-ERROR: instruction requires: sve
130// CHECK-UNKNOWN: 20 e1 f0 04 <unknown>
131
132incd    x0, vl32
133// CHECK-INST: incd    x0, vl32
134// CHECK-ENCODING: [0x40,0xe1,0xf0,0x04]
135// CHECK-ERROR: instruction requires: sve
136// CHECK-UNKNOWN: 40 e1 f0 04 <unknown>
137
138incd    x0, vl64
139// CHECK-INST: incd    x0, vl64
140// CHECK-ENCODING: [0x60,0xe1,0xf0,0x04]
141// CHECK-ERROR: instruction requires: sve
142// CHECK-UNKNOWN: 60 e1 f0 04 <unknown>
143
144incd    x0, vl128
145// CHECK-INST: incd    x0, vl128
146// CHECK-ENCODING: [0x80,0xe1,0xf0,0x04]
147// CHECK-ERROR: instruction requires: sve
148// CHECK-UNKNOWN: 80 e1 f0 04 <unknown>
149
150incd    x0, vl256
151// CHECK-INST: incd    x0, vl256
152// CHECK-ENCODING: [0xa0,0xe1,0xf0,0x04]
153// CHECK-ERROR: instruction requires: sve
154// CHECK-UNKNOWN: a0 e1 f0 04 <unknown>
155
156incd    x0, #14
157// CHECK-INST: incd    x0, #14
158// CHECK-ENCODING: [0xc0,0xe1,0xf0,0x04]
159// CHECK-ERROR: instruction requires: sve
160// CHECK-UNKNOWN: c0 e1 f0 04 <unknown>
161
162incd    x0, #28
163// CHECK-INST: incd    x0, #28
164// CHECK-ENCODING: [0x80,0xe3,0xf0,0x04]
165// CHECK-ERROR: instruction requires: sve
166// CHECK-UNKNOWN: 80 e3 f0 04 <unknown>
167
168
169// --------------------------------------------------------------------------//
170// Test compatibility with MOVPRFX instruction.
171
172movprfx z0, z7
173// CHECK-INST: movprfx	z0, z7
174// CHECK-ENCODING: [0xe0,0xbc,0x20,0x04]
175// CHECK-ERROR: instruction requires: sve
176// CHECK-UNKNOWN: e0 bc 20 04 <unknown>
177
178incd    z0.d
179// CHECK-INST: incd	z0.d
180// CHECK-ENCODING: [0xe0,0xc3,0xf0,0x04]
181// CHECK-ERROR: instruction requires: sve
182// CHECK-UNKNOWN: e0 c3 f0 04 <unknown>
183
184movprfx z0, z7
185// CHECK-INST: movprfx	z0, z7
186// CHECK-ENCODING: [0xe0,0xbc,0x20,0x04]
187// CHECK-ERROR: instruction requires: sve
188// CHECK-UNKNOWN: e0 bc 20 04 <unknown>
189
190incd    z0.d, all, mul #16
191// CHECK-INST: incd	z0.d, all, mul #16
192// CHECK-ENCODING: [0xe0,0xc3,0xff,0x04]
193// CHECK-ERROR: instruction requires: sve
194// CHECK-UNKNOWN: e0 c3 ff 04 <unknown>
195
196movprfx z0, z7
197// CHECK-INST: movprfx	z0, z7
198// CHECK-ENCODING: [0xe0,0xbc,0x20,0x04]
199// CHECK-ERROR: instruction requires: sve
200// CHECK-UNKNOWN: e0 bc 20 04 <unknown>
201
202incd    z0.d, all
203// CHECK-INST: incd	z0.d
204// CHECK-ENCODING: [0xe0,0xc3,0xf0,0x04]
205// CHECK-ERROR: instruction requires: sve
206// CHECK-UNKNOWN: e0 c3 f0 04 <unknown>
207