1// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve  2>&1 < %s| FileCheck %s
2
3// --------------------------------------------------------------------------//
4// Restricted predicate out of range.
5
6fcmla z0.d, p8/m, z1.d, z2.d, #0
7// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
8// CHECK-NEXT: fcmla z0.d, p8/m, z1.d, z2.d, #0
9// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
10
11
12// --------------------------------------------------------------------------//
13// Invalid rotation
14
15fcmla z0.d, p0/m, z1.d, z2.d, #360
16// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: complex rotation must be 0, 90, 180 or 270.
17// CHECK-NEXT: fcmla z0.d, p0/m, z1.d, z2.d, #360
18// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
19
20fcmla z0.d, p0/m, z1.d, z2.d, #450
21// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: complex rotation must be 0, 90, 180 or 270.
22// CHECK-NEXT: fcmla z0.d, p0/m, z1.d, z2.d, #450
23// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
24
25
26// --------------------------------------------------------------------------//
27// Index out of bounds or invalid for element size
28
29fcmla z0.h, z1.h, z2.h[-1], #0
30// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 3].
31// CHECK-NEXT: fcmla z0.h, z1.h, z2.h[-1], #0
32// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
33
34fcmla z0.h, z1.h, z2.h[4], #0
35// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 3].
36// CHECK-NEXT: fcmla z0.h, z1.h, z2.h[4], #0
37// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
38
39fcmla z0.s, z1.s, z2.s[-1], #0
40// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 1].
41// CHECK-NEXT: fcmla z0.s, z1.s, z2.s[-1], #0
42// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
43
44fcmla z0.s, z1.s, z2.s[2], #0
45// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: vector lane must be an integer in range [0, 1].
46// CHECK-NEXT: fcmla z0.s, z1.s, z2.s[2], #0
47// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
48
49fcmla z0.d, z1.d, z2.d[0], #0
50// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand
51// CHECK-NEXT: fcmla z0.d, z1.d, z2.d[0], #0
52// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
53
54
55// --------------------------------------------------------------------------//
56// Negative tests for instructions that are incompatible with movprfx
57
58movprfx z21.s, p0/z, z28.s
59fcmla   z21.s, z10.s, z5.s[1], #90
60// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a predicated movprfx, suggest using unpredicated movprfx
61// CHECK-NEXT: fcmla   z21.s, z10.s, z5.s[1], #90
62// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
63