• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
6cmpeq p0.b, p8/z, z0.b, z0.b
7// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
8// CHECK-NEXT: cmpeq p0.b, p8/z, z0.b, z0.b
9// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
10
11
12// --------------------------------------------------------------------------//
13// Invalid predicate operation
14
15cmpeq p0.b, p0/m, z0.b, z0.b
16// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
17// CHECK-NEXT: cmpeq p0.b, p0/m, z0.b, z0.b
18// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
19
20
21// --------------------------------------------------------------------------//
22// Invalid source registers
23
24cmpeq p0.b, p0/z, z0.b, z0.h
25// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
26// CHECK-NEXT: cmpeq p0.b, p0/z, z0.b, z0.h
27// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
28
29cmpeq p0.h, p0/z, z0.h, z0.s
30// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
31// CHECK-NEXT: cmpeq p0.h, p0/z, z0.h, z0.s
32// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
33
34cmpeq p0.s, p0/z, z0.s, z0.h
35// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
36// CHECK-NEXT: cmpeq p0.s, p0/z, z0.s, z0.h
37// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
38
39cmpeq p0.d, p0/z, z0.d, z0.s
40// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
41// CHECK-NEXT: cmpeq p0.d, p0/z, z0.d, z0.s
42// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
43
44cmpeq p0.b, p0/z, z0.h, z0.h
45// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
46// CHECK-NEXT: cmpeq p0.b, p0/z, z0.h, z0.h
47// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
48
49cmpeq p0.h, p0/z, z0.s, z0.s
50// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
51// CHECK-NEXT: cmpeq p0.h, p0/z, z0.s, z0.s
52// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
53
54cmpeq p0.s, p0/z, z0.h, z0.h
55// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
56// CHECK-NEXT: cmpeq p0.s, p0/z, z0.h, z0.h
57// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
58
59cmpeq p0.d, p0/z, z0.s, z0.s
60// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
61// CHECK-NEXT: cmpeq p0.d, p0/z, z0.s, z0.s
62// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
63
64
65// --------------------------------------------------------------------------//
66// Invalid immediate range
67
68cmpeq p0.s, p0/z, z0.s, #-17
69// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be an integer in range [-16, 15].
70// CHECK-NEXT: cmpeq p0.s, p0/z, z0.s, #-17
71// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
72
73cmpeq p0.s, p0/z, z0.s, #16
74// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be an integer in range [-16, 15].
75// CHECK-NEXT: cmpeq p0.s, p0/z, z0.s, #16
76// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
77
78
79// --------------------------------------------------------------------------//
80// Negative tests for instructions that are incompatible with movprfx
81
82movprfx z0.d, p0/z, z7.d
83cmpeq   p0.d, p0/z, z0.d, #15
84// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
85// CHECK-NEXT: cmpeq   p0.d, p0/z, z0.d, #15
86// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
87
88movprfx z0, z7
89cmpeq   p0.d, p0/z, z0.d, #15
90// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
91// CHECK-NEXT: cmpeq   p0.d, p0/z, z0.d, #15
92// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
93
94movprfx z0.s, p0/z, z7.s
95cmpeq   p0.s, p0/z, z0.s, z0.d
96// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
97// CHECK-NEXT: cmpeq   p0.s, p0/z, z0.s, z0.d
98// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
99
100movprfx z0, z7
101cmpeq   p0.s, p0/z, z0.s, z0.d
102// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
103// CHECK-NEXT: cmpeq   p0.s, p0/z, z0.s, z0.d
104// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
105