1// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve  2>&1 < %s| FileCheck %s
2
3
4// ------------------------------------------------------------------------- //
5// Invalid destination or source register.
6
7saddv s0, p7, z31.b
8// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
9// CHECK-NEXT: saddv s0, p7, z31.b
10// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
11
12saddv s0, p7, z31.h
13// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
14// CHECK-NEXT: saddv s0, p7, z31.h
15// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
16
17saddv s0, p7, z31.s
18// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
19// CHECK-NEXT: saddv s0, p7, z31.s
20// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
21
22saddv d0, p7, z31.d
23// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
24// CHECK-NEXT: saddv d0, p7, z31.d
25// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
26
27
28// ------------------------------------------------------------------------- //
29// Invalid predicate
30
31saddv d0, p8, z31.b
32// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
33// CHECK-NEXT: saddv d0, p8, z31.b
34// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
35
36saddv d0, p7.b, z31.b
37// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
38// CHECK-NEXT: saddv d0, p7.b, z31.b
39// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
40
41saddv d0, p7.q, z31.b
42// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
43// CHECK-NEXT: saddv d0, p7.q, z31.b
44// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
45
46
47// --------------------------------------------------------------------------//
48// Negative tests for instructions that are incompatible with movprfx
49
50movprfx z31.s, p7/z, z6.s
51saddv d0, p7, z31.s
52// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
53// CHECK-NEXT: saddv d0, p7, z31.s
54// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
55
56movprfx z31, z6
57saddv d0, p7, z31.s
58// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
59// CHECK-NEXT: saddv d0, p7, z31.s
60// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
61