[InstCombine] Signed saturation patterns
[llvm-complete.git] / test / MC / AArch64 / SVE / prfw-diagnostics.s
blobfcace08e17b97eaae5ec65104fab1ff8919c6d30
1 // RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s
4 // --------------------------------------------------------------------------//
5 // invalid/missing predicate operation specifier
7 prfw p0, [x0]
8 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: prefetch hint expected
9 // CHECK-NEXT: prfw p0, [x0]
10 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
12 prfw #16, p0, [x0]
13 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: prefetch operand out of range, [0,15] expected
14 // CHECK-NEXT: prfw #16, p0, [x0]
15 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
17 prfw plil1keep, p0, [x0]
18 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: prefetch hint expected
19 // CHECK-NEXT: prfw plil1keep, p0, [x0]
20 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
22 prfw #pldl1keep, p0, [x0]
23 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: immediate value expected for prefetch operand
24 // CHECK-NEXT: prfw #pldl1keep, p0, [x0]
25 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
28 // --------------------------------------------------------------------------//
29 // invalid scalar + scalar addressing modes
31 prfw #0, p0, [x0, #-33, mul vl]
32 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be an integer in range [-32, 31].
33 // CHECK-NEXT: prfw #0, p0, [x0, #-33, mul vl]
34 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
36 prfw #0, p0, [x0, #32, mul vl]
37 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be an integer in range [-32, 31].
38 // CHECK-NEXT: prfw #0, p0, [x0, #32, mul vl]
39 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
41 prfw #0, p0, [x0, w0]
42 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 with required shift 'lsl #2'
43 // CHECK-NEXT: prfw #0, p0, [x0, w0]
44 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
46 prfw #0, p0, [x0, x0, uxtw]
47 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 with required shift 'lsl #2'
48 // CHECK-NEXT: prfw #0, p0, [x0, x0, uxtw]
49 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
51 prfw #0, p0, [x0, x0, lsl #1]
52 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 with required shift 'lsl #2'
53 // CHECK-NEXT: prfw #0, p0, [x0, x0, lsl #1]
54 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
57 // --------------------------------------------------------------------------//
58 // Invalid scalar + vector addressing modes
60 prfw #0, p0, [x0, z0.h]
61 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand
62 // CHECK-NEXT: prfw #0, p0, [x0, z0.h]
63 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
65 prfw #0, p0, [x0, z0.s]
66 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].s, (uxtw|sxtw) #2'
67 // CHECK-NEXT: prfw #0, p0, [x0, z0.s]
68 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
70 prfw #0, p0, [x0, z0.s]
71 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].s, (uxtw|sxtw) #2'
72 // CHECK-NEXT: prfw #0, p0, [x0, z0.s]
73 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
75 prfw #0, p0, [x0, z0.s, uxtw #3]
76 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].s, (uxtw|sxtw) #2'
77 // CHECK-NEXT: prfw #0, p0, [x0, z0.s, uxtw #3]
78 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
80 prfw #0, p0, [x0, z0.s, lsl #2]
81 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].s, (uxtw|sxtw) #2'
82 // CHECK-NEXT: prfw #0, p0, [x0, z0.s, lsl #2]
83 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
85 prfw #0, p0, [x0, z0.d, lsl #3]
86 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].d, (lsl|uxtw|sxtw) #2'
87 // CHECK-NEXT: prfw #0, p0, [x0, z0.d, lsl #3]
88 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
90 prfw #0, p0, [x0, z0.d, sxtw #3]
91 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].d, (lsl|uxtw|sxtw) #2'
92 // CHECK-NEXT: prfw #0, p0, [x0, z0.d, sxtw #3]
93 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
96 // --------------------------------------------------------------------------//
97 // Invalid vector + immediate addressing modes
99 prfw #0, p0, [z0.s, #-4]
100 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 4 in range [0, 124].
101 // CHECK-NEXT: prfw #0, p0, [z0.s, #-4]
102 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
104 prfw #0, p0, [z0.s, #-1]
105 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 4 in range [0, 124].
106 // CHECK-NEXT: prfw #0, p0, [z0.s, #-1]
107 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
109 prfw #0, p0, [z0.s, #125]
110 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 4 in range [0, 124].
111 // CHECK-NEXT: prfw #0, p0, [z0.s, #125]
112 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
114 prfw #0, p0, [z0.s, #128]
115 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 4 in range [0, 124].
116 // CHECK-NEXT: prfw #0, p0, [z0.s, #128]
117 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
119 prfw #0, p0, [z0.s, #3]
120 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 4 in range [0, 124].
121 // CHECK-NEXT: prfw #0, p0, [z0.s, #3]
122 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
124 prfw #0, p0, [z0.d, #-4]
125 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 4 in range [0, 124].
126 // CHECK-NEXT: prfw #0, p0, [z0.d, #-4]
127 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
129 prfw #0, p0, [z0.d, #-1]
130 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 4 in range [0, 124].
131 // CHECK-NEXT: prfw #0, p0, [z0.d, #-1]
132 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
134 prfw #0, p0, [z0.d, #125]
135 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 4 in range [0, 124].
136 // CHECK-NEXT: prfw #0, p0, [z0.d, #125]
137 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
139 prfw #0, p0, [z0.d, #128]
140 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 4 in range [0, 124].
141 // CHECK-NEXT: prfw #0, p0, [z0.d, #128]
142 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
144 prfw #0, p0, [z0.d, #3]
145 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 4 in range [0, 124].
146 // CHECK-NEXT: prfw #0, p0, [z0.d, #3]
147 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
150 // --------------------------------------------------------------------------//
151 // Invalid predicate
153 prfw #0, p8, [x0]
154 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
155 // CHECK-NEXT: prfw #0, p8, [x0]
156 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
158 prfw #0, p7.b, [x0]
159 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
160 // CHECK-NEXT: prfw #0, p7.b, [x0]
161 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
163 prfw #0, p7.q, [x0]
164 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
165 // CHECK-NEXT: prfw #0, p7.q, [x0]
166 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
169 // --------------------------------------------------------------------------//
170 // Negative tests for instructions that are incompatible with movprfx
172 movprfx z8.d, p3/z, z15.d
173 prfw #7, p3, [x13, z8.d, uxtw #2]
174 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
175 // CHECK-NEXT: prfw #7, p3, [x13, z8.d, uxtw #2]
176 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
178 movprfx z8, z15
179 prfw #7, p3, [x13, z8.d, uxtw #2]
180 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
181 // CHECK-NEXT: prfw #7, p3, [x13, z8.d, uxtw #2]
182 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
184 movprfx z21.d, p5/z, z28.d
185 prfw pldl3strm, p5, [x10, z21.d, lsl #2]
186 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
187 // CHECK-NEXT: prfw pldl3strm, p5, [x10, z21.d, lsl #2]
188 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
190 movprfx z21, z28
191 prfw pldl3strm, p5, [x10, z21.d, lsl #2]
192 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
193 // CHECK-NEXT: prfw pldl3strm, p5, [x10, z21.d, lsl #2]
194 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: