[InstCombine] Signed saturation patterns
[llvm-complete.git] / test / MC / AArch64 / SVE / ldff1h-diagnostics.s
blob6a8a1f51ea82ea350a5b964dd29d2400e94f38fe
1 // RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s
3 // --------------------------------------------------------------------------//
4 // Invalid operand (.b)
6 ldff1h z9.b, p7/z, [x0]
7 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
8 // CHECK-NEXT: ldff1h z9.b, p7/z, [x0]
9 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
11 // --------------------------------------------------------------------------//
12 // restricted predicate has range [0, 7].
14 ldff1h z9.h, p8/z, [x0]
15 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
16 // CHECK-NEXT: ldff1h z9.h, p8/z, [x0]
17 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
19 ldff1h z12.s, p8/z, [x0]
20 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
21 // CHECK-NEXT: ldff1h z12.s, p8/z, [x0]
22 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
24 ldff1h z4.d, p8/z, [x0]
25 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
26 // CHECK-NEXT: ldff1h z4.d, p8/z, [x0]
27 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
29 // --------------------------------------------------------------------------//
30 // Invalid scalar + scalar addressing modes
32 ldff1h z0.h, p0/z, [x0, sp]
33 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 or xzr, with required shift 'lsl #1'
34 // CHECK-NEXT: ldff1h z0.h, p0/z, [x0, sp]
35 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
37 ldff1h z0.h, p0/z, [x0, x0, lsl #2]
38 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 or xzr, with required shift 'lsl #1'
39 // CHECK-NEXT: ldff1h z0.h, p0/z, [x0, x0, lsl #2]
40 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
42 ldff1h z0.h, p0/z, [x0, w0]
43 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 or xzr, with required shift 'lsl #1'
44 // CHECK-NEXT: ldff1h z0.h, p0/z, [x0, w0]
45 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
47 ldff1h z0.h, p0/z, [x0, w0, uxtw]
48 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 or xzr, with required shift 'lsl #1'
49 // CHECK-NEXT: ldff1h z0.h, p0/z, [x0, w0, uxtw]
50 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
53 // --------------------------------------------------------------------------//
54 // Invalid scalar + vector addressing modes
56 ldff1h z0.d, p0/z, [x0, z0.h]
57 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand
58 // CHECK-NEXT: ldff1h z0.d, p0/z, [x0, z0.h]
59 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
61 ldff1h z0.d, p0/z, [x0, z0.s]
62 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand
63 // CHECK-NEXT: ldff1h z0.d, p0/z, [x0, z0.s]
64 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
66 ldff1h z0.s, p0/z, [x0, z0.s]
67 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].s, (uxtw|sxtw)'
68 // CHECK-NEXT: ldff1h z0.s, p0/z, [x0, z0.s]
69 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
71 ldff1h z0.s, p0/z, [x0, z0.s, uxtw #2]
72 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].s, (uxtw|sxtw) #1'
73 // CHECK-NEXT: ldff1h z0.s, p0/z, [x0, z0.s, uxtw #2]
74 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
76 ldff1h z0.s, p0/z, [x0, z0.s, lsl #1]
77 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].s, (uxtw|sxtw) #1'
78 // CHECK-NEXT: ldff1h z0.s, p0/z, [x0, z0.s, lsl #1]
79 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
81 ldff1h z0.d, p0/z, [x0, z0.d, lsl #2]
82 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].d, (lsl|uxtw|sxtw) #1'
83 // CHECK-NEXT: ldff1h z0.d, p0/z, [x0, z0.d, lsl #2]
84 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
86 ldff1h z0.d, p0/z, [x0, z0.d, sxtw #2]
87 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].d, (lsl|uxtw|sxtw) #1'
88 // CHECK-NEXT: ldff1h z0.d, p0/z, [x0, z0.d, sxtw #2]
89 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
92 // --------------------------------------------------------------------------//
93 // Invalid vector + immediate addressing modes
95 ldff1h z0.s, p0/z, [z0.s, #-2]
96 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
97 // CHECK-NEXT: ldff1h z0.s, p0/z, [z0.s, #-2]
98 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
100 ldff1h z0.s, p0/z, [z0.s, #-1]
101 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
102 // CHECK-NEXT: ldff1h z0.s, p0/z, [z0.s, #-1]
103 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
105 ldff1h z0.s, p0/z, [z0.s, #63]
106 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
107 // CHECK-NEXT: ldff1h z0.s, p0/z, [z0.s, #63]
108 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
110 ldff1h z0.s, p0/z, [z0.s, #64]
111 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
112 // CHECK-NEXT: ldff1h z0.s, p0/z, [z0.s, #64]
113 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
115 ldff1h z0.s, p0/z, [z0.s, #3]
116 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
117 // CHECK-NEXT: ldff1h z0.s, p0/z, [z0.s, #3]
118 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
120 ldff1h z0.d, p0/z, [z0.d, #-2]
121 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
122 // CHECK-NEXT: ldff1h z0.d, p0/z, [z0.d, #-2]
123 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
125 ldff1h z0.d, p0/z, [z0.d, #-1]
126 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
127 // CHECK-NEXT: ldff1h z0.d, p0/z, [z0.d, #-1]
128 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
130 ldff1h z0.d, p0/z, [z0.d, #63]
131 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
132 // CHECK-NEXT: ldff1h z0.d, p0/z, [z0.d, #63]
133 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
135 ldff1h z0.d, p0/z, [z0.d, #64]
136 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
137 // CHECK-NEXT: ldff1h z0.d, p0/z, [z0.d, #64]
138 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
140 ldff1h z0.d, p0/z, [z0.d, #3]
141 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
142 // CHECK-NEXT: ldff1h z0.d, p0/z, [z0.d, #3]
143 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
146 // --------------------------------------------------------------------------//
147 // Negative tests for instructions that are incompatible with movprfx
149 movprfx z0.d, p0/z, z7.d
150 ldff1h { z0.d }, p0/z, [z0.d]
151 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
152 // CHECK-NEXT: ldff1h { z0.d }, p0/z, [z0.d]
153 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
155 movprfx z0, z7
156 ldff1h { z0.d }, p0/z, [z0.d]
157 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
158 // CHECK-NEXT: ldff1h { z0.d }, p0/z, [z0.d]
159 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: