1 // RUN
: not llvm-mc
-triple
=aarch64
-show-encoding
-mattr
=+sve
2>&1 < %s| FileCheck
%s
3 // --------------------------------------------------------------------------//
4 // Restricted predicate out of range.
6 cmphs 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
: cmphs p0.
b, p8
/z
, z0.
b, z0.
b
9 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
12 // --------------------------------------------------------------------------//
13 // Invalid predicate operation
15 cmphs p0.
b, p0
/m
, z0.
b, z0.
b
16 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid operand for instruction
17 // CHECK-NEXT
: cmphs p0.
b, p0
/m
, z0.
b, z0.
b
18 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
21 // --------------------------------------------------------------------------//
22 // Invalid source registers
24 cmphs p0.
b, p0
/z
, z0.
b, z0.h
25 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid element width
26 // CHECK-NEXT
: cmphs p0.
b, p0
/z
, z0.
b, z0.h
27 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
29 cmphs p0.h
, p0
/z
, z0.h
, z0.s
30 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid element width
31 // CHECK-NEXT
: cmphs p0.h
, p0
/z
, z0.h
, z0.s
32 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
34 cmphs p0.s
, p0
/z
, z0.s
, z0.h
35 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid element width
36 // CHECK-NEXT
: cmphs p0.s
, p0
/z
, z0.s
, z0.h
37 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
39 cmphs p0.d
, p0
/z
, z0.d
, z0.s
40 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid element width
41 // CHECK-NEXT
: cmphs p0.d
, p0
/z
, z0.d
, z0.s
42 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
44 cmphs p0.
b, p0
/z
, z0.h
, z0.h
45 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid element width
46 // CHECK-NEXT
: cmphs p0.
b, p0
/z
, z0.h
, z0.h
47 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
49 cmphs p0.h
, p0
/z
, z0.s
, z0.s
50 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid element width
51 // CHECK-NEXT
: cmphs p0.h
, p0
/z
, z0.s
, z0.s
52 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
54 cmphs p0.s
, p0
/z
, z0.h
, z0.h
55 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid element width
56 // CHECK-NEXT
: cmphs p0.s
, p0
/z
, z0.h
, z0.h
57 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
59 cmphs p0.d
, p0
/z
, z0.s
, z0.s
60 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: invalid element width
61 // CHECK-NEXT
: cmphs p0.d
, p0
/z
, z0.s
, z0.s
62 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
65 // --------------------------------------------------------------------------//
66 // Invalid immediate range
68 cmphs p0.s
, p0
/z
, z0.s
, #-1
69 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 127].
70 // CHECK-NEXT
: cmphs p0.s
, p0
/z
, z0.s
, #-1
71 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
73 cmphs p0.s
, p0
/z
, z0.s
, #128
74 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: immediate must
be an integer in range
[0, 127].
75 // CHECK-NEXT
: cmphs p0.s
, p0
/z
, z0.s
, #128
76 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
79 // --------------------------------------------------------------------------//
80 // Negative tests for instructions that are incompatible with movprfx
82 movprfx z0.d
, p0
/z
, z7.d
83 cmphs p0.d
, p0
/z
, z0.d
, #127
84 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: instruction is unpredictable when following
a movprfx
, suggest replacing movprfx with mov
85 // CHECK-NEXT
: cmphs p0.d
, p0
/z
, z0.d
, #127
86 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
89 cmphs p0.d
, p0
/z
, z0.d
, #127
90 // CHECK
: [[@LINE-
1]]:{{[0-9]+}}: error
: instruction is unpredictable when following
a movprfx
, suggest replacing movprfx with mov
91 // CHECK-NEXT
: cmphs p0.d
, p0
/z
, z0.d
, #127
92 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
94 movprfx z0.s
, p0
/z
, z7.s
95 cmphs 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
: cmphs p0.s
, p0
/z
, z0.s
, z0.d
98 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}:
101 cmphs 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
: cmphs p0.s
, p0
/z
, z0.s
, z0.d
104 // CHECK-
NOT: [[@LINE-
1]]:{{[0-9]+}}: