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