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