[InstCombine] Signed saturation patterns
[llvm-complete.git] / test / MC / AArch64 / SVE / ldff1sh-diagnostics.s
blob7d10c655d5e7a87c66261c34a102898c3d17f46a
1 // RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sve 2>&1 < %s| FileCheck %s
3 // --------------------------------------------------------------------------//
4 // Invalid operand (.h)
6 ldff1sh z9.h, p7/z, [x0]
7 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
8 // CHECK-NEXT: ldff1sh z9.h, p7/z, [x0]
9 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
11 // --------------------------------------------------------------------------//
12 // restricted predicate has range [0, 7].
14 ldff1sh z12.s, p8/z, [x0]
15 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
16 // CHECK-NEXT: ldff1sh z12.s, p8/z, [x0]
17 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
19 ldff1sh z4.d, p8/z, [x0]
20 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
21 // CHECK-NEXT: ldff1sh z4.d, p8/z, [x0]
22 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
24 // --------------------------------------------------------------------------//
25 // Invalid scalar + scalar addressing modes
27 ldff1sh z0.s, p0/z, [x0, sp]
28 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 or xzr, with required shift 'lsl #1'
29 // CHECK-NEXT: ldff1sh z0.s, p0/z, [x0, sp]
30 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
32 ldff1sh z0.s, p0/z, [x0, x0, lsl #2]
33 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 or xzr, with required shift 'lsl #1'
34 // CHECK-NEXT: ldff1sh z0.s, p0/z, [x0, x0, lsl #2]
35 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
37 ldff1sh z0.s, p0/z, [x0, w0]
38 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 or xzr, with required shift 'lsl #1'
39 // CHECK-NEXT: ldff1sh z0.s, p0/z, [x0, w0]
40 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
42 ldff1sh z0.s, p0/z, [x0, w0, uxtw]
43 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: register must be x0..x30 or xzr, with required shift 'lsl #1'
44 // CHECK-NEXT: ldff1sh z0.s, p0/z, [x0, w0, uxtw]
45 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
47 // --------------------------------------------------------------------------//
48 // Invalid scalar + vector addressing modes
50 ldff1sh z0.d, p0/z, [x0, z0.h]
51 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand
52 // CHECK-NEXT: ldff1sh z0.d, p0/z, [x0, z0.h]
53 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
55 ldff1sh z0.d, p0/z, [x0, z0.s]
56 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand
57 // CHECK-NEXT: ldff1sh z0.d, p0/z, [x0, z0.s]
58 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
60 ldff1sh z0.s, p0/z, [x0, z0.s]
61 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].s, (uxtw|sxtw)'
62 // CHECK-NEXT: ldff1sh z0.s, p0/z, [x0, z0.s]
63 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
65 ldff1sh z0.s, p0/z, [x0, z0.s, uxtw #2]
66 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].s, (uxtw|sxtw) #1'
67 // CHECK-NEXT: ldff1sh z0.s, p0/z, [x0, z0.s, uxtw #2]
68 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
70 ldff1sh z0.s, p0/z, [x0, z0.s, lsl #1]
71 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].s, (uxtw|sxtw) #1'
72 // CHECK-NEXT: ldff1sh z0.s, p0/z, [x0, z0.s, lsl #1]
73 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
75 ldff1sh z0.d, p0/z, [x0, z0.d, lsl #2]
76 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].d, (lsl|uxtw|sxtw) #1'
77 // CHECK-NEXT: ldff1sh z0.d, p0/z, [x0, z0.d, lsl #2]
78 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
80 ldff1sh z0.d, p0/z, [x0, z0.d, sxtw #2]
81 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid shift/extend specified, expected 'z[0..31].d, (lsl|uxtw|sxtw) #1'
82 // CHECK-NEXT: ldff1sh z0.d, p0/z, [x0, z0.d, sxtw #2]
83 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
86 // --------------------------------------------------------------------------//
87 // Invalid vector + immediate addressing modes
89 ldff1sh z0.s, p0/z, [z0.s, #-2]
90 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
91 // CHECK-NEXT: ldff1sh z0.s, p0/z, [z0.s, #-2]
92 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
94 ldff1sh z0.s, p0/z, [z0.s, #-1]
95 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
96 // CHECK-NEXT: ldff1sh z0.s, p0/z, [z0.s, #-1]
97 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
99 ldff1sh z0.s, p0/z, [z0.s, #63]
100 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
101 // CHECK-NEXT: ldff1sh z0.s, p0/z, [z0.s, #63]
102 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
104 ldff1sh z0.s, p0/z, [z0.s, #64]
105 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
106 // CHECK-NEXT: ldff1sh z0.s, p0/z, [z0.s, #64]
107 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
109 ldff1sh z0.s, p0/z, [z0.s, #3]
110 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
111 // CHECK-NEXT: ldff1sh z0.s, p0/z, [z0.s, #3]
112 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
114 ldff1sh z0.d, p0/z, [z0.d, #-2]
115 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
116 // CHECK-NEXT: ldff1sh z0.d, p0/z, [z0.d, #-2]
117 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
119 ldff1sh z0.d, p0/z, [z0.d, #-1]
120 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
121 // CHECK-NEXT: ldff1sh z0.d, p0/z, [z0.d, #-1]
122 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
124 ldff1sh z0.d, p0/z, [z0.d, #63]
125 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
126 // CHECK-NEXT: ldff1sh z0.d, p0/z, [z0.d, #63]
127 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
129 ldff1sh z0.d, p0/z, [z0.d, #64]
130 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
131 // CHECK-NEXT: ldff1sh z0.d, p0/z, [z0.d, #64]
132 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
134 ldff1sh z0.d, p0/z, [z0.d, #3]
135 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: index must be a multiple of 2 in range [0, 62].
136 // CHECK-NEXT: ldff1sh z0.d, p0/z, [z0.d, #3]
137 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
140 // --------------------------------------------------------------------------//
141 // Negative tests for instructions that are incompatible with movprfx
143 movprfx z0.d, p0/z, z7.d
144 ldff1sh { z0.d }, p0/z, [z0.d]
145 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
146 // CHECK-NEXT: ldff1sh { z0.d }, p0/z, [z0.d]
147 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
149 movprfx z0, z7
150 ldff1sh { z0.d }, p0/z, [z0.d]
151 // CHECK: [[@LINE-1]]:{{[0-9]+}}: error: instruction is unpredictable when following a movprfx, suggest replacing movprfx with mov
152 // CHECK-NEXT: ldff1sh { z0.d }, p0/z, [z0.d]
153 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}: