[ARM] Better OR's for MVE compares
[llvm-core.git] / test / MC / AArch64 / SVE / movprfx-diagnostics.s
blob3eb833312f2154f8ae6bae01d43562af432e747d
1 // RUN: not llvm-mc -triple=aarch64-none-linux-gnu -show-encoding -mattr=+sve 2>&1 < %s | FileCheck %s
3 // ------------------------------------------------------------------------- //
4 // Type suffix on unpredicated movprfx
6 movprfx z0.b, z1.b
7 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
8 // CHECK-NEXT: movprfx z0.b, z1.b
9 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
11 movprfx z0.b, z1.s
12 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
13 // CHECK-NEXT: movprfx z0.b, z1.s
14 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
16 movprfx z0, z1.s
17 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: expected register without element width suffix
18 // CHECK-NEXT: movprfx z0, z1.s
19 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
22 // ------------------------------------------------------------------------- //
23 // Different destination register (unary)
25 movprfx z0, z1
26 abs z2.d, p0/m, z2.d
27 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx writing to a different destination
28 // CHECK-NEXT: abs z2.d, p0/m, z2.d
29 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
32 // ------------------------------------------------------------------------- //
33 // Different destination register (binary)
35 movprfx z0, z1
36 add z2.d, p0/m, z2.d, z0.d
37 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx writing to a different destination
38 // CHECK-NEXT: add z2.d, p0/m, z2.d, z0.d
39 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
42 // ------------------------------------------------------------------------- //
43 // Different destination register (wide element)
45 movprfx z0, z1
46 asr z2.s, p0/m, z2.s, z0.d
47 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx writing to a different destination
48 // CHECK-NEXT: asr z2.s, p0/m, z2.s, z0.d
49 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
52 // ------------------------------------------------------------------------- //
53 // Different destination register (ternary)
55 movprfx z0, z1
56 mla z3.d, p0/m, z1.d, z2.d
57 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx writing to a different destination
58 // CHECK-NEXT: mla z3.d, p0/m, z1.d, z2.d
59 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
62 // ------------------------------------------------------------------------- //
63 // Destination used in other operand (unary)
65 movprfx z0, z1
66 abs z0.d, p0/m, z0.d
67 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx and destination also used as non-destructive source
68 // CHECK-NEXT: abs z0.d, p0/m, z0.d
69 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
71 movprfx z0.d, p0/z, z1.d
72 cpy z0.d, p0/m, d0
73 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx and destination also used as non-destructive source
74 // CHECK-NEXT: cpy z0.d, p0/m, d0
75 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
77 movprfx z0.d, p0/z, z1.d
78 mov z0.d, p0/m, d0
79 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx and destination also used as non-destructive source
80 // CHECK-NEXT: mov z0.d, p0/m, d0
81 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
83 // ------------------------------------------------------------------------- //
84 // Destination used in other operand (binary)
86 movprfx z0, z1
87 add z0.d, p0/m, z0.d, z0.d
88 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx and destination also used as non-destructive source
89 // CHECK-NEXT: add z0.d, p0/m, z0.d, z0.d
90 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
93 // ------------------------------------------------------------------------- //
94 // Destination used in other operand (wide element)
96 movprfx z0, z1
97 asr z0.s, p0/m, z0.s, z0.d
98 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx and destination also used as non-destructive source
99 // CHECK-NEXT: asr z0.s, p0/m, z0.s, z0.d
100 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
103 // ------------------------------------------------------------------------- //
104 // Destination used in other operand (ternary)
106 movprfx z0, z1
107 mla z0.d, p0/m, z0.d, z2.d
108 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx and destination also used as non-destructive source
109 // CHECK-NEXT: mla z0.d, p0/m, z0.d, z2.d
110 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
113 // ------------------------------------------------------------------------- //
114 // Destination used in other operand (ternary + indexed)
116 movprfx z0, z1
117 sdot z0.s, z1.b, z0.b[3]
118 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx and destination also used as non-destructive source
119 // CHECK-NEXT: sdot z0.s, z1.b, z0.b[3]
120 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
123 // ------------------------------------------------------------------------- //
124 // Different general predicate (unary)
126 movprfx z0.d, p0/m, z1.d
127 abs z0.d, p1/m, z1.d
128 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a predicated movprfx using a different general predicate
129 // CHECK-NEXT: abs z0.d, p1/m, z1.d
130 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
133 // ------------------------------------------------------------------------- //
134 // Different general predicate (binary)
136 movprfx z0.d, p0/m, z1.d
137 add z0.d, p1/m, z0.d, z1.d
138 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a predicated movprfx using a different general predicate
139 // CHECK-NEXT: add z0.d, p1/m, z0.d, z1.d
140 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
143 // ------------------------------------------------------------------------- //
144 // Different general predicate (wide element)
146 movprfx z0.d, p0/m, z1.d
147 asr z0.s, p1/m, z0.s, z1.d
148 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a predicated movprfx using a different general predicate
149 // CHECK-NEXT: asr z0.s, p1/m, z0.s, z1.d
150 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
153 // ------------------------------------------------------------------------- //
154 // Different general predicate (ternary)
156 movprfx z0.d, p0/m, z1.d
157 mla z0.d, p1/m, z1.d, z2.d
158 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a predicated movprfx using a different general predicate
159 // CHECK-NEXT: mla z0.d, p1/m, z1.d, z2.d
160 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
163 // ------------------------------------------------------------------------- //
164 // Different element size (unary)
166 movprfx z0.s, p0/m, z1.s
167 abs z0.d, p0/m, z1.d
168 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a predicated movprfx with a different element size
169 // CHECK-NEXT: abs z0.d, p0/m, z1.d
170 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
173 // ------------------------------------------------------------------------- //
174 // Different element size (binary)
176 movprfx z0.s, p0/m, z1.s
177 add z0.d, p0/m, z0.d, z1.d
178 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a predicated movprfx with a different element size
179 // CHECK-NEXT: add z0.d, p0/m, z0.d, z1.d
180 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
183 // ------------------------------------------------------------------------- //
184 // Different element size (wide element)
186 movprfx z0.d, p0/m, z1.d
187 asr z0.s, p0/m, z0.s, z1.d
188 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a predicated movprfx with a different element size
189 // CHECK-NEXT: asr z0.s, p0/m, z0.s, z1.d
190 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
193 // ------------------------------------------------------------------------- //
194 // Different element size (ternary)
196 movprfx z0.s, p0/m, z1.s
197 mla z0.d, p0/m, z1.d, z2.d
198 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a predicated movprfx with a different element size
199 // CHECK-NEXT: mla z0.d, p0/m, z1.d, z2.d
200 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
203 // ------------------------------------------------------------------------- //
204 // Predicated movprfx with non-predicated instruction.
206 movprfx z0.d, p0/m, z1.d
207 add z0.d, z0.d, #1
208 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a predicated movprfx, suggest using unpredicated movprfx
209 // CHECK-NEXT: add z0.d, z0.d, #1
210 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
213 // ------------------------------------------------------------------------- //
214 // Ensure we don't try to apply a prefix to subsequent instructions (upon failure)
216 movprfx z0, z1
217 add z0.d, z1.d, z2.d
218 add z0.d, z1.d, z2.d
219 // CHECK: [[@LINE-2]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
220 // CHECK-NEXT: add z0.d, z1.d, z2.d
221 // CHECK-NOT: [[@LINE-3]]:{{[0-9]+}}:
222 // CHECK: add z0.d, z1.d, z2.d