[InstCombine] Signed saturation patterns
[llvm-complete.git] / test / MC / AArch64 / SVE / lsr.s
blob4813261249301b3184be15205e6e6761bae55ace
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 lsr z0.b, z0.b, #1
11 // CHECK-INST: lsr z0.b, z0.b, #1
12 // CHECK-ENCODING: [0x00,0x94,0x2f,0x04]
13 // CHECK-ERROR: instruction requires: sve
14 // CHECK-UNKNOWN: 00 94 2f 04 <unknown>
16 lsr z31.b, z31.b, #8
17 // CHECK-INST: lsr z31.b, z31.b, #8
18 // CHECK-ENCODING: [0xff,0x97,0x28,0x04]
19 // CHECK-ERROR: instruction requires: sve
20 // CHECK-UNKNOWN: ff 97 28 04 <unknown>
22 lsr z0.h, z0.h, #1
23 // CHECK-INST: lsr z0.h, z0.h, #1
24 // CHECK-ENCODING: [0x00,0x94,0x3f,0x04]
25 // CHECK-ERROR: instruction requires: sve
26 // CHECK-UNKNOWN: 00 94 3f 04 <unknown>
28 lsr z31.h, z31.h, #16
29 // CHECK-INST: lsr z31.h, z31.h, #16
30 // CHECK-ENCODING: [0xff,0x97,0x30,0x04]
31 // CHECK-ERROR: instruction requires: sve
32 // CHECK-UNKNOWN: ff 97 30 04 <unknown>
34 lsr z0.s, z0.s, #1
35 // CHECK-INST: lsr z0.s, z0.s, #1
36 // CHECK-ENCODING: [0x00,0x94,0x7f,0x04]
37 // CHECK-ERROR: instruction requires: sve
38 // CHECK-UNKNOWN: 00 94 7f 04 <unknown>
40 lsr z31.s, z31.s, #32
41 // CHECK-INST: lsr z31.s, z31.s, #32
42 // CHECK-ENCODING: [0xff,0x97,0x60,0x04]
43 // CHECK-ERROR: instruction requires: sve
44 // CHECK-UNKNOWN: ff 97 60 04 <unknown>
46 lsr z0.d, z0.d, #1
47 // CHECK-INST: lsr z0.d, z0.d, #1
48 // CHECK-ENCODING: [0x00,0x94,0xff,0x04]
49 // CHECK-ERROR: instruction requires: sve
50 // CHECK-UNKNOWN: 00 94 ff 04 <unknown>
52 lsr z31.d, z31.d, #64
53 // CHECK-INST: lsr z31.d, z31.d, #64
54 // CHECK-ENCODING: [0xff,0x97,0xa0,0x04]
55 // CHECK-ERROR: instruction requires: sve
56 // CHECK-UNKNOWN: ff 97 a0 04 <unknown>
58 lsr z0.b, p0/m, z0.b, #1
59 // CHECK-INST: lsr z0.b, p0/m, z0.b, #1
60 // CHECK-ENCODING: [0xe0,0x81,0x01,0x04]
61 // CHECK-ERROR: instruction requires: sve
62 // CHECK-UNKNOWN: e0 81 01 04 <unknown>
64 lsr z31.b, p0/m, z31.b, #8
65 // CHECK-INST: lsr z31.b, p0/m, z31.b, #8
66 // CHECK-ENCODING: [0x1f,0x81,0x01,0x04]
67 // CHECK-ERROR: instruction requires: sve
68 // CHECK-UNKNOWN: 1f 81 01 04 <unknown>
70 lsr z0.h, p0/m, z0.h, #1
71 // CHECK-INST: lsr z0.h, p0/m, z0.h, #1
72 // CHECK-ENCODING: [0xe0,0x83,0x01,0x04]
73 // CHECK-ERROR: instruction requires: sve
74 // CHECK-UNKNOWN: e0 83 01 04 <unknown>
76 lsr z31.h, p0/m, z31.h, #16
77 // CHECK-INST: lsr z31.h, p0/m, z31.h, #16
78 // CHECK-ENCODING: [0x1f,0x82,0x01,0x04]
79 // CHECK-ERROR: instruction requires: sve
80 // CHECK-UNKNOWN: 1f 82 01 04 <unknown>
82 lsr z0.s, p0/m, z0.s, #1
83 // CHECK-INST: lsr z0.s, p0/m, z0.s, #1
84 // CHECK-ENCODING: [0xe0,0x83,0x41,0x04]
85 // CHECK-ERROR: instruction requires: sve
86 // CHECK-UNKNOWN: e0 83 41 04 <unknown>
88 lsr z31.s, p0/m, z31.s, #32
89 // CHECK-INST: lsr z31.s, p0/m, z31.s, #32
90 // CHECK-ENCODING: [0x1f,0x80,0x41,0x04]
91 // CHECK-ERROR: instruction requires: sve
92 // CHECK-UNKNOWN: 1f 80 41 04 <unknown>
94 lsr z0.d, p0/m, z0.d, #1
95 // CHECK-INST: lsr z0.d, p0/m, z0.d, #1
96 // CHECK-ENCODING: [0xe0,0x83,0xc1,0x04]
97 // CHECK-ERROR: instruction requires: sve
98 // CHECK-UNKNOWN: e0 83 c1 04 <unknown>
100 lsr z31.d, p0/m, z31.d, #64
101 // CHECK-INST: lsr z31.d, p0/m, z31.d, #64
102 // CHECK-ENCODING: [0x1f,0x80,0x81,0x04]
103 // CHECK-ERROR: instruction requires: sve
104 // CHECK-UNKNOWN: 1f 80 81 04 <unknown>
106 lsr z0.b, p0/m, z0.b, z0.b
107 // CHECK-INST: lsr z0.b, p0/m, z0.b, z0.b
108 // CHECK-ENCODING: [0x00,0x80,0x11,0x04]
109 // CHECK-ERROR: instruction requires: sve
110 // CHECK-UNKNOWN: 00 80 11 04 <unknown>
112 lsr z0.h, p0/m, z0.h, z0.h
113 // CHECK-INST: lsr z0.h, p0/m, z0.h, z0.h
114 // CHECK-ENCODING: [0x00,0x80,0x51,0x04]
115 // CHECK-ERROR: instruction requires: sve
116 // CHECK-UNKNOWN: 00 80 51 04 <unknown>
118 lsr z0.s, p0/m, z0.s, z0.s
119 // CHECK-INST: lsr z0.s, p0/m, z0.s, z0.s
120 // CHECK-ENCODING: [0x00,0x80,0x91,0x04]
121 // CHECK-ERROR: instruction requires: sve
122 // CHECK-UNKNOWN: 00 80 91 04 <unknown>
124 lsr z0.d, p0/m, z0.d, z0.d
125 // CHECK-INST: lsr z0.d, p0/m, z0.d, z0.d
126 // CHECK-ENCODING: [0x00,0x80,0xd1,0x04]
127 // CHECK-ERROR: instruction requires: sve
128 // CHECK-UNKNOWN: 00 80 d1 04 <unknown>
130 lsr z0.b, p0/m, z0.b, z1.d
131 // CHECK-INST: lsr z0.b, p0/m, z0.b, z1.d
132 // CHECK-ENCODING: [0x20,0x80,0x19,0x04]
133 // CHECK-ERROR: instruction requires: sve
134 // CHECK-UNKNOWN: 20 80 19 04 <unknown>
136 lsr z0.h, p0/m, z0.h, z1.d
137 // CHECK-INST: lsr z0.h, p0/m, z0.h, z1.d
138 // CHECK-ENCODING: [0x20,0x80,0x59,0x04]
139 // CHECK-ERROR: instruction requires: sve
140 // CHECK-UNKNOWN: 20 80 59 04 <unknown>
142 lsr z0.s, p0/m, z0.s, z1.d
143 // CHECK-INST: lsr z0.s, p0/m, z0.s, z1.d
144 // CHECK-ENCODING: [0x20,0x80,0x99,0x04]
145 // CHECK-ERROR: instruction requires: sve
146 // CHECK-UNKNOWN: 20 80 99 04 <unknown>
148 lsr z0.b, z1.b, z2.d
149 // CHECK-INST: lsr z0.b, z1.b, z2.d
150 // CHECK-ENCODING: [0x20,0x84,0x22,0x04]
151 // CHECK-ERROR: instruction requires: sve
152 // CHECK-UNKNOWN: 20 84 22 04 <unknown>
154 lsr z0.h, z1.h, z2.d
155 // CHECK-INST: lsr z0.h, z1.h, z2.d
156 // CHECK-ENCODING: [0x20,0x84,0x62,0x04]
157 // CHECK-ERROR: instruction requires: sve
158 // CHECK-UNKNOWN: 20 84 62 04 <unknown>
160 lsr z0.s, z1.s, z2.d
161 // CHECK-INST: lsr z0.s, z1.s, z2.d
162 // CHECK-ENCODING: [0x20,0x84,0xa2,0x04]
163 // CHECK-ERROR: instruction requires: sve
164 // CHECK-UNKNOWN: 20 84 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 lsr z31.d, p0/m, z31.d, #64
177 // CHECK-INST: lsr z31.d, p0/m, z31.d, #64
178 // CHECK-ENCODING: [0x1f,0x80,0x81,0x04]
179 // CHECK-ERROR: instruction requires: sve
180 // CHECK-UNKNOWN: 1f 80 81 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 lsr z31.d, p0/m, z31.d, #64
189 // CHECK-INST: lsr z31.d, p0/m, z31.d, #64
190 // CHECK-ENCODING: [0x1f,0x80,0x81,0x04]
191 // CHECK-ERROR: instruction requires: sve
192 // CHECK-UNKNOWN: 1f 80 81 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 lsr z0.s, p0/m, z0.s, z1.d
201 // CHECK-INST: lsr z0.s, p0/m, z0.s, z1.d
202 // CHECK-ENCODING: [0x20,0x80,0x99,0x04]
203 // CHECK-ERROR: instruction requires: sve
204 // CHECK-UNKNOWN: 20 80 99 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 lsr z0.s, p0/m, z0.s, z1.d
213 // CHECK-INST: lsr z0.s, p0/m, z0.s, z1.d
214 // CHECK-ENCODING: [0x20,0x80,0x99,0x04]
215 // CHECK-ERROR: instruction requires: sve
216 // CHECK-UNKNOWN: 20 80 99 04 <unknown>