[llvm-readobj] - Simplify stack-sizes.test test case.
[llvm-complete.git] / test / MC / AArch64 / SVE / asr.s
blobd514eda2af13ca090a753ec0075c88c80713448f
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
10 asr z0.b, z0.b, #1
11 // CHECK-INST: asr z0.b, z0.b, #1
12 // CHECK-ENCODING: [0x00,0x90,0x2f,0x04]
13 // CHECK-ERROR: instruction requires: sve
14 // CHECK-UNKNOWN: 00 90 2f 04 <unknown>
16 asr z31.b, z31.b, #8
17 // CHECK-INST: asr z31.b, z31.b, #8
18 // CHECK-ENCODING: [0xff,0x93,0x28,0x04]
19 // CHECK-ERROR: instruction requires: sve
20 // CHECK-UNKNOWN: ff 93 28 04 <unknown>
22 asr z0.h, z0.h, #1
23 // CHECK-INST: asr z0.h, z0.h, #1
24 // CHECK-ENCODING: [0x00,0x90,0x3f,0x04]
25 // CHECK-ERROR: instruction requires: sve
26 // CHECK-UNKNOWN: 00 90 3f 04 <unknown>
28 asr z31.h, z31.h, #16
29 // CHECK-INST: asr z31.h, z31.h, #16
30 // CHECK-ENCODING: [0xff,0x93,0x30,0x04]
31 // CHECK-ERROR: instruction requires: sve
32 // CHECK-UNKNOWN: ff 93 30 04 <unknown>
34 asr z0.s, z0.s, #1
35 // CHECK-INST: asr z0.s, z0.s, #1
36 // CHECK-ENCODING: [0x00,0x90,0x7f,0x04]
37 // CHECK-ERROR: instruction requires: sve
38 // CHECK-UNKNOWN: 00 90 7f 04 <unknown>
40 asr z31.s, z31.s, #32
41 // CHECK-INST: asr z31.s, z31.s, #32
42 // CHECK-ENCODING: [0xff,0x93,0x60,0x04]
43 // CHECK-ERROR: instruction requires: sve
44 // CHECK-UNKNOWN: ff 93 60 04 <unknown>
46 asr z0.d, z0.d, #1
47 // CHECK-INST: asr z0.d, z0.d, #1
48 // CHECK-ENCODING: [0x00,0x90,0xff,0x04]
49 // CHECK-ERROR: instruction requires: sve
50 // CHECK-UNKNOWN: 00 90 ff 04 <unknown>
52 asr z31.d, z31.d, #64
53 // CHECK-INST: asr z31.d, z31.d, #64
54 // CHECK-ENCODING: [0xff,0x93,0xa0,0x04]
55 // CHECK-ERROR: instruction requires: sve
56 // CHECK-UNKNOWN: ff 93 a0 04 <unknown>
58 asr z0.b, p0/m, z0.b, #1
59 // CHECK-INST: asr z0.b, p0/m, z0.b, #1
60 // CHECK-ENCODING: [0xe0,0x81,0x00,0x04]
61 // CHECK-ERROR: instruction requires: sve
62 // CHECK-UNKNOWN: e0 81 00 04 <unknown>
64 asr z31.b, p0/m, z31.b, #8
65 // CHECK-INST: asr z31.b, p0/m, z31.b, #8
66 // CHECK-ENCODING: [0x1f,0x81,0x00,0x04]
67 // CHECK-ERROR: instruction requires: sve
68 // CHECK-UNKNOWN: 1f 81 00 04 <unknown>
70 asr z0.h, p0/m, z0.h, #1
71 // CHECK-INST: asr z0.h, p0/m, z0.h, #1
72 // CHECK-ENCODING: [0xe0,0x83,0x00,0x04]
73 // CHECK-ERROR: instruction requires: sve
74 // CHECK-UNKNOWN: e0 83 00 04 <unknown>
76 asr z31.h, p0/m, z31.h, #16
77 // CHECK-INST: asr z31.h, p0/m, z31.h, #16
78 // CHECK-ENCODING: [0x1f,0x82,0x00,0x04]
79 // CHECK-ERROR: instruction requires: sve
80 // CHECK-UNKNOWN: 1f 82 00 04 <unknown>
82 asr z0.s, p0/m, z0.s, #1
83 // CHECK-INST: asr z0.s, p0/m, z0.s, #1
84 // CHECK-ENCODING: [0xe0,0x83,0x40,0x04]
85 // CHECK-ERROR: instruction requires: sve
86 // CHECK-UNKNOWN: e0 83 40 04 <unknown>
88 asr z31.s, p0/m, z31.s, #32
89 // CHECK-INST: asr z31.s, p0/m, z31.s, #32
90 // CHECK-ENCODING: [0x1f,0x80,0x40,0x04]
91 // CHECK-ERROR: instruction requires: sve
92 // CHECK-UNKNOWN: 1f 80 40 04 <unknown>
94 asr z0.d, p0/m, z0.d, #1
95 // CHECK-INST: asr z0.d, p0/m, z0.d, #1
96 // CHECK-ENCODING: [0xe0,0x83,0xc0,0x04]
97 // CHECK-ERROR: instruction requires: sve
98 // CHECK-UNKNOWN: e0 83 c0 04 <unknown>
100 asr z31.d, p0/m, z31.d, #64
101 // CHECK-INST: asr z31.d, p0/m, z31.d, #64
102 // CHECK-ENCODING: [0x1f,0x80,0x80,0x04]
103 // CHECK-ERROR: instruction requires: sve
104 // CHECK-UNKNOWN: 1f 80 80 04 <unknown>
106 asr z0.b, p0/m, z0.b, z0.b
107 // CHECK-INST: asr z0.b, p0/m, z0.b, z0.b
108 // CHECK-ENCODING: [0x00,0x80,0x10,0x04]
109 // CHECK-ERROR: instruction requires: sve
110 // CHECK-UNKNOWN: 00 80 10 04 <unknown>
112 asr z0.h, p0/m, z0.h, z0.h
113 // CHECK-INST: asr z0.h, p0/m, z0.h, z0.h
114 // CHECK-ENCODING: [0x00,0x80,0x50,0x04]
115 // CHECK-ERROR: instruction requires: sve
116 // CHECK-UNKNOWN: 00 80 50 04 <unknown>
118 asr z0.s, p0/m, z0.s, z0.s
119 // CHECK-INST: asr z0.s, p0/m, z0.s, z0.s
120 // CHECK-ENCODING: [0x00,0x80,0x90,0x04]
121 // CHECK-ERROR: instruction requires: sve
122 // CHECK-UNKNOWN: 00 80 90 04 <unknown>
124 asr z0.d, p0/m, z0.d, z0.d
125 // CHECK-INST: asr z0.d, p0/m, z0.d, z0.d
126 // CHECK-ENCODING: [0x00,0x80,0xd0,0x04]
127 // CHECK-ERROR: instruction requires: sve
128 // CHECK-UNKNOWN: 00 80 d0 04 <unknown>
130 asr z0.b, p0/m, z0.b, z1.d
131 // CHECK-INST: asr z0.b, p0/m, z0.b, z1.d
132 // CHECK-ENCODING: [0x20,0x80,0x18,0x04]
133 // CHECK-ERROR: instruction requires: sve
134 // CHECK-UNKNOWN: 20 80 18 04 <unknown>
136 asr z0.h, p0/m, z0.h, z1.d
137 // CHECK-INST: asr z0.h, p0/m, z0.h, z1.d
138 // CHECK-ENCODING: [0x20,0x80,0x58,0x04]
139 // CHECK-ERROR: instruction requires: sve
140 // CHECK-UNKNOWN: 20 80 58 04 <unknown>
142 asr z0.s, p0/m, z0.s, z1.d
143 // CHECK-INST: asr z0.s, p0/m, z0.s, z1.d
144 // CHECK-ENCODING: [0x20,0x80,0x98,0x04]
145 // CHECK-ERROR: instruction requires: sve
146 // CHECK-UNKNOWN: 20 80 98 04 <unknown>
148 asr z0.b, z1.b, z2.d
149 // CHECK-INST: asr z0.b, z1.b, z2.d
150 // CHECK-ENCODING: [0x20,0x80,0x22,0x04]
151 // CHECK-ERROR: instruction requires: sve
152 // CHECK-UNKNOWN: 20 80 22 04 <unknown>
154 asr z0.h, z1.h, z2.d
155 // CHECK-INST: asr z0.h, z1.h, z2.d
156 // CHECK-ENCODING: [0x20,0x80,0x62,0x04]
157 // CHECK-ERROR: instruction requires: sve
158 // CHECK-UNKNOWN: 20 80 62 04 <unknown>
160 asr z0.s, z1.s, z2.d
161 // CHECK-INST: asr z0.s, z1.s, z2.d
162 // CHECK-ENCODING: [0x20,0x80,0xa2,0x04]
163 // CHECK-ERROR: instruction requires: sve
164 // CHECK-UNKNOWN: 20 80 a2 04 <unknown>
167 // --------------------------------------------------------------------------//
168 // Test compatibility with MOVPRFX instruction.
170 movprfx z31.d, p0/z, z6.d
171 // CHECK-INST: movprfx z31.d, p0/z, z6.d
172 // CHECK-ENCODING: [0xdf,0x20,0xd0,0x04]
173 // CHECK-ERROR: instruction requires: sve
174 // CHECK-UNKNOWN: df 20 d0 04 <unknown>
176 asr z31.d, p0/m, z31.d, #64
177 // CHECK-INST: asr z31.d, p0/m, z31.d, #64
178 // CHECK-ENCODING: [0x1f,0x80,0x80,0x04]
179 // CHECK-ERROR: instruction requires: sve
180 // CHECK-UNKNOWN: 1f 80 80 04 <unknown>
182 movprfx z31, z6
183 // CHECK-INST: movprfx z31, z6
184 // CHECK-ENCODING: [0xdf,0xbc,0x20,0x04]
185 // CHECK-ERROR: instruction requires: sve
186 // CHECK-UNKNOWN: df bc 20 04 <unknown>
188 asr z31.d, p0/m, z31.d, #64
189 // CHECK-INST: asr z31.d, p0/m, z31.d, #64
190 // CHECK-ENCODING: [0x1f,0x80,0x80,0x04]
191 // CHECK-ERROR: instruction requires: sve
192 // CHECK-UNKNOWN: 1f 80 80 04 <unknown>
194 movprfx z0.s, p0/z, z7.s
195 // CHECK-INST: movprfx z0.s, p0/z, z7.s
196 // CHECK-ENCODING: [0xe0,0x20,0x90,0x04]
197 // CHECK-ERROR: instruction requires: sve
198 // CHECK-UNKNOWN: e0 20 90 04 <unknown>
200 asr z0.s, p0/m, z0.s, z1.d
201 // CHECK-INST: asr z0.s, p0/m, z0.s, z1.d
202 // CHECK-ENCODING: [0x20,0x80,0x98,0x04]
203 // CHECK-ERROR: instruction requires: sve
204 // CHECK-UNKNOWN: 20 80 98 04 <unknown>
206 movprfx z0, z7
207 // CHECK-INST: movprfx z0, z7
208 // CHECK-ENCODING: [0xe0,0xbc,0x20,0x04]
209 // CHECK-ERROR: instruction requires: sve
210 // CHECK-UNKNOWN: e0 bc 20 04 <unknown>
212 asr z0.s, p0/m, z0.s, z1.d
213 // CHECK-INST: asr z0.s, p0/m, z0.s, z1.d
214 // CHECK-ENCODING: [0x20,0x80,0x98,0x04]
215 // CHECK-ERROR: instruction requires: sve
216 // CHECK-UNKNOWN: 20 80 98 04 <unknown>