[ARM] Better OR's for MVE compares
[llvm-core.git] / test / MC / AArch64 / SVE2 / cmla-diagnostics.s
blob145a57a1d65cc4f527790300c6cc2190d28218cb
1 // RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve2 2>&1 < %s| FileCheck %s
4 // ------------------------------------------------------------------------- //
5 // Invalid element size
7 cmla z0.h, z1.b, z2.b[0], #0
8 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
9 // CHECK-NEXT: cmla z0.h, z1.b, z2.b[0], #0
10 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
12 cmla z0.h, z1.s, z2.s[0], #0
13 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
14 // CHECK-NEXT: cmla z0.h, z1.s, z2.s[0], #0
15 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
17 cmla z0.h, z1.d, z2.d[0], #0
18 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
19 // CHECK-NEXT: cmla z0.h, z1.d, z2.d[0], #0
20 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
22 cmla z0.s, z1.b, z2.b[0], #0
23 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
24 // CHECK-NEXT: cmla z0.s, z1.b, z2.b[0], #0
25 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
27 cmla z0.s, z1.h, z2.h[0], #0
28 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
29 // CHECK-NEXT: cmla z0.s, z1.h, z2.h[0], #0
30 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
32 cmla z0.s, z1.d, z2.d[0], #0
33 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
34 // CHECK-NEXT: cmla z0.s, z1.d, z2.d[0], #0
35 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
38 // ------------------------------------------------------------------------- //
39 // Invalid restricted register for indexed vector.
41 cmla z0.h, z1.h, z8.h[3], #0
42 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
43 // CHECK-NEXT: cmla z0.h, z1.h, z8.h[3], #0
44 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
46 cmla z0.s, z1.s, z16.s[1], #0
47 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
48 // CHECK-NEXT: cmla z0.s, z1.s, z16.s[1], #0
49 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
52 // ------------------------------------------------------------------------- //
53 // Invalid element index
55 cmla z0.h, z1.h, z7.h[-1], #0
56 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 3].
57 // CHECK-NEXT: cmla z0.h, z1.h, z7.h[-1], #0
58 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
60 cmla z0.h, z1.h, z7.h[4], #0
61 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 3].
62 // CHECK-NEXT: cmla z0.h, z1.h, z7.h[4], #0
63 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
65 cmla z0.s, z1.s, z15.s[-1], #0
66 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 1].
67 // CHECK-NEXT: cmla z0.s, z1.s, z15.s[-1], #0
68 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
70 cmla z0.s, z1.s, z15.s[2], #0
71 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 1].
72 // CHECK-NEXT: cmla z0.s, z1.s, z15.s[2], #0
73 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
76 // --------------------------------------------------------------------------//
77 // Invalid rotation
79 cmla z0.h, z1.h, z2.h[0], #360
80 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: complex rotation must be 0, 90, 180 or 270.
81 // CHECK-NEXT: cmla z0.h, z1.h, z2.h[0], #360
82 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
84 cmla z0.s, z1.s, z2.s[0], #450
85 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: complex rotation must be 0, 90, 180 or 270.
86 // CHECK-NEXT: cmla z0.s, z1.s, z2.s[0], #450
87 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
90 // --------------------------------------------------------------------------//
91 // Negative tests for instructions that are incompatible with movprfx
93 movprfx z0.b, p0/z, z7.b
94 cmla z0.b, z1.b, z31.b, #0
95 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a predicated movprfx, suggest using unpredicated movprfx
96 // CHECK-NEXT: cmla z0.b, z1.b, z31.b, #0
97 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
99 movprfx z0.s, p0/z, z7.s
100 cmla z0.s, z1.s, z15.s[1], #0
101 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a predicated movprfx, suggest using unpredicated movprfx
102 // CHECK-NEXT: cmla z0.s, z1.s, z15.s[1], #0
103 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: