Skip to content

Commit 3bf5f7c

Browse files
committed
fixup! [AArch64][llvm] Armv9.7-A: Add support for SVE2p3 shift operations
Add extra testcases for non-consecutive vectors, and sort out movprfx test
1 parent 625c2d4 commit 3bf5f7c

File tree

1 file changed

+41
-12
lines changed

1 file changed

+41
-12
lines changed

llvm/test/MC/AArch64/SVE2p3/qshrn-diagnostics.s

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,18 @@ sqrshrn z10.b, { z0.h, z1.h }, #9
3434
// CHECK-NEXT: sqrshrn z10.b, { z0.h, z1.h }, #9
3535
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
3636

37+
sqrshrn z10.b, { z1.h, z2.h }, #1
38+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors, where the first vector is a multiple of 2 and with matching element types
39+
// CHECK-NEXT: sqrshrn z10.b, { z1.h, z2.h }, #1
40+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
41+
3742
// --------------------------------------------------------------------------//
3843
// Negative tests for instructions that are incompatible with movprfx
3944

4045
movprfx z0, z7
41-
sqrshrn z10.b, { z0.h, z1.h }, #1
46+
sqrshrn z0.b, { z2.h, z3.h }, #1
4247
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
43-
// CHECK-NEXT: sqrshrn z10.b, { z0.h, z1.h }, #1
48+
// CHECK-NEXT: sqrshrn z0.b, { z2.h, z3.h }, #1
4449
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
4550

4651
// --------------------------------------------------------------------------//
@@ -77,13 +82,18 @@ sqrshrun z10.b, { z0.h, z1.h }, #9
7782
// CHECK-NEXT: sqrshrun z10.b, { z0.h, z1.h }, #9
7883
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
7984

85+
sqrshrun z10.b, { z1.h, z2.h }, #1
86+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors, where the first vector is a multiple of 2 and with matching element types
87+
// CHECK-NEXT: sqrshrun z10.b, { z1.h, z2.h }, #1
88+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
89+
8090
// --------------------------------------------------------------------------//
8191
// Negative tests for instructions that are incompatible with movprfx
8292

8393
movprfx z0, z7
84-
sqrshrun z10.b, { z0.h, z1.h }, #1
94+
sqrshrun z0.b, { z0.h, z1.h }, #1
8595
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
86-
// CHECK-NEXT: sqrshrun z10.b, { z0.h, z1.h }, #1
96+
// CHECK-NEXT: sqrshrun z0.b, { z0.h, z1.h }, #1
8797
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
8898

8999
// --------------------------------------------------------------------------//
@@ -122,14 +132,18 @@ sqshrn z0.h, { z0.s, z1.s }, #17
122132
// CHECK-NEXT: sqshrn z0.h, { z0.s, z1.s }, #17
123133
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
124134

135+
sqshrn z10.b, { z1.h, z2.h }, #1
136+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors, where the first vector is a multiple of 2 and with matching element types
137+
// CHECK-NEXT: sqshrn z10.b, { z1.h, z2.h }, #1
138+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
125139

126140
// --------------------------------------------------------------------------//
127141
// Negative tests for instructions that are incompatible with movprfx
128142

129143
movprfx z0, z7
130-
sqshrn z10.b, { z0.h, z1.h }, #1
144+
sqshrn z0.b, { z0.h, z1.h }, #1
131145
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
132-
// CHECK-NEXT: sqshrn z10.b, { z0.h, z1.h }, #1
146+
// CHECK-NEXT: sqshrn z0.b, { z0.h, z1.h }, #1
133147
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
134148

135149
// --------------------------------------------------------------------------//
@@ -168,13 +182,18 @@ sqshrun z10.h, { z0.s, z1.s }, #17
168182
// CHECK-NEXT: sqshrun z10.h, { z0.s, z1.s }, #17
169183
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
170184

185+
sqshrun z10.b, { z1.h, z2.h }, #1
186+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors, where the first vector is a multiple of 2 and with matching element types
187+
// CHECK-NEXT: sqshrun z10.b, { z1.h, z2.h }, #1
188+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
189+
171190
// --------------------------------------------------------------------------//
172191
// Negative tests for instructions that are incompatible with movprfx
173192

174193
movprfx z0, z7
175-
sqshrun z10.b, { z0.h, z1.h }, #1
194+
sqshrun z0.b, { z0.h, z1.h }, #1
176195
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
177-
// CHECK-NEXT: sqshrun z10.b, { z0.h, z1.h }, #1
196+
// CHECK-NEXT: sqshrun z0.b, { z0.h, z1.h }, #1
178197
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
179198

180199
// --------------------------------------------------------------------------//
@@ -211,13 +230,18 @@ uqrshrn z10.b, { z0.h, z1.h }, #9
211230
// CHECK-NEXT: uqrshrn z10.b, { z0.h, z1.h }, #9
212231
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
213232

233+
uqrshrn z10.b, { z1.h, z2.h }, #1
234+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors, where the first vector is a multiple of 2 and with matching element types
235+
// CHECK-NEXT: uqrshrn z10.b, { z1.h, z2.h }, #1
236+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
237+
214238
// --------------------------------------------------------------------------//
215239
// Negative tests for instructions that are incompatible with movprfx
216240

217241
movprfx z0, z7
218-
uqrshrn z10.b, { z0.h, z1.h }, #1
242+
uqrshrn z0.b, { z0.h, z1.h }, #1
219243
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
220-
// CHECK-NEXT: uqrshrn z10.b, { z0.h, z1.h }, #1
244+
// CHECK-NEXT: uqrshrn z0.b, { z0.h, z1.h }, #1
221245
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
222246

223247
// --------------------------------------------------------------------------//
@@ -256,11 +280,16 @@ uqshrn z0.h, { z0.s, z1.s }, #17
256280
// CHECK-NEXT: uqshrn z0.h, { z0.s, z1.s }, #17
257281
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
258282

283+
uqshrn z10.b, { z1.h, z2.h }, #1
284+
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: Invalid vector list, expected list with 2 consecutive SVE vectors, where the first vector is a multiple of 2 and with matching element types
285+
// CHECK-NEXT: uqshrn z10.b, { z1.h, z2.h }, #1
286+
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
287+
259288
// --------------------------------------------------------------------------//
260289
// Negative tests for instructions that are incompatible with movprfx
261290

262291
movprfx z0, z7
263-
uqshrn z10.b, { z0.h, z1.h }, #1
292+
uqshrn z0.b, { z0.h, z1.h }, #1
264293
// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
265-
// CHECK-NEXT: uqshrn z10.b, { z0.h, z1.h }, #1
294+
// CHECK-NEXT: uqshrn z0.b, { z0.h, z1.h }, #1
266295
// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

0 commit comments

Comments
 (0)