[InstCombine] Signed saturation patterns
[llvm-core.git] / test / MC / AArch64 / SVE2 / sqshlu-diagnostics.s
blob3158d91e7e549592fe67b4ed2cf443ee97325729
1 // RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s
3 sqshlu z0.b, p0/m, z0.b, #-1
4 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 7]
5 // CHECK-NEXT: sqshlu z0.b, p0/m, z0.b, #-1
6 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
8 sqshlu z0.b, p0/m, z0.b, #8
9 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 7]
10 // CHECK-NEXT: sqshlu z0.b, p0/m, z0.b, #8
11 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
13 sqshlu z0.h, p0/m, z0.h, #-1
14 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 15]
15 // CHECK-NEXT: sqshlu z0.h, p0/m, z0.h, #-1
16 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
18 sqshlu z0.h, p0/m, z0.h, #16
19 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 15]
20 // CHECK-NEXT: sqshlu z0.h, p0/m, z0.h, #16
21 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
23 sqshlu z0.s, p0/m, z0.s, #-1
24 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 31]
25 // CHECK-NEXT: sqshlu z0.s, p0/m, z0.s, #-1
26 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
28 sqshlu z0.s, p0/m, z0.s, #32
29 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 31]
30 // CHECK-NEXT: sqshlu z0.s, p0/m, z0.s, #32
31 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
33 sqshlu z0.d, p0/m, z0.d, #-1
34 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 63]
35 // CHECK-NEXT: sqshlu z0.d, p0/m, z0.d, #-1
36 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
38 sqshlu z0.d, p0/m, z0.d, #64
39 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate must be an integer in range [0, 63]
40 // CHECK-NEXT: sqshlu z0.d, p0/m, z0.d, #64
41 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
44 // --------------------------------------------------------------------------//
45 // Source and Destination Registers must match
47 sqshlu z0.b, p0/m, z1.b, #0
48 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: operand must match destination register
49 // CHECK-NEXT: sqshlu z0.b, p0/m, z1.b, #0
50 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
53 // --------------------------------------------------------------------------//
54 // Element sizes must match
56 sqshlu z0.b, p0/m, z0.d, #0
57 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
58 // CHECK-NEXT: sqshlu z0.b, p0/m, z0.d, #0
59 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
61 sqshlu z0.d, p0/m, z0.b, #0
62 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
63 // CHECK-NEXT: sqshlu z0.d, p0/m, z0.b, #0
64 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
67 // --------------------------------------------------------------------------//
68 // Invalid predicate
70 sqshlu z0.b, p0/z, z0.b, #0
71 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
72 // CHECK-NEXT: sqshlu z0.b, p0/z, z0.b, #0
73 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
75 sqshlu z0.b, p8/m, z0.b, #0
76 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
77 // CHECK-NEXT: sqshlu z0.b, p8/m, z0.b, #0
78 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: