1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
4 # Test selecting G_REV instructions.
6 # Each test is named like:
8 # (G_REV_VERSION)_(INSTRUCTION_PRODUCED)
10 # Each of these patterns come from AArch64GenGlobalISel.inc.
15 name: rev64_REV64v2i32
19 tracksRegLiveness: true
23 ; CHECK-LABEL: name: rev64_REV64v2i32
25 ; CHECK: %copy:fpr64 = COPY $d0
26 ; CHECK: %rev:fpr64 = REV64v2i32 %copy
27 ; CHECK: $d0 = COPY %rev
28 ; CHECK: RET_ReallyLR implicit $d0
29 %copy:fpr(<2 x s32>) = COPY $d0
30 %rev:fpr(<2 x s32>) = G_REV64 %copy
31 $d0 = COPY %rev(<2 x s32>)
32 RET_ReallyLR implicit $d0
36 name: rev64_REV64v4i16
40 tracksRegLiveness: true
44 ; CHECK-LABEL: name: rev64_REV64v4i16
46 ; CHECK: %copy:fpr64 = COPY $d0
47 ; CHECK: %rev:fpr64 = REV64v4i16 %copy
48 ; CHECK: $d0 = COPY %rev
49 ; CHECK: RET_ReallyLR implicit $d0
50 %copy:fpr(<4 x s16>) = COPY $d0
51 %rev:fpr(<4 x s16>) = G_REV64 %copy
52 $d0 = COPY %rev(<4 x s16>)
53 RET_ReallyLR implicit $d0
57 name: rev64_REV64v4i32
61 tracksRegLiveness: true
65 ; CHECK-LABEL: name: rev64_REV64v4i32
67 ; CHECK: %copy:fpr128 = COPY $q0
68 ; CHECK: %rev:fpr128 = REV64v4i32 %copy
69 ; CHECK: $q0 = COPY %rev
70 ; CHECK: RET_ReallyLR implicit $q0
71 %copy:fpr(<4 x s32>) = COPY $q0
72 %rev:fpr(<4 x s32>) = G_REV64 %copy
73 $q0 = COPY %rev(<4 x s32>)
74 RET_ReallyLR implicit $q0
82 tracksRegLiveness: true
86 ; CHECK-LABEL: name: rev64_REV64v8i8
88 ; CHECK: %copy:fpr64 = COPY $d0
89 ; CHECK: %rev:fpr64 = REV64v8i8 %copy
90 ; CHECK: $d0 = COPY %rev
91 ; CHECK: RET_ReallyLR implicit $d0
92 %copy:fpr(<8 x s8>) = COPY $d0
93 %rev:fpr(<8 x s8>) = G_REV64 %copy
94 $d0 = COPY %rev(<8 x s8>)
95 RET_ReallyLR implicit $d0
99 name: rev64_REV64v8i16
102 regBankSelected: true
103 tracksRegLiveness: true
107 ; CHECK-LABEL: name: rev64_REV64v8i16
108 ; CHECK: liveins: $q0
109 ; CHECK: %copy:fpr128 = COPY $q0
110 ; CHECK: %rev:fpr128 = REV64v8i16 %copy
111 ; CHECK: $q0 = COPY %rev
112 ; CHECK: RET_ReallyLR implicit $q0
113 %copy:fpr(<8 x s16>) = COPY $q0
114 %rev:fpr(<8 x s16>) = G_REV64 %copy
115 $q0 = COPY %rev(<8 x s16>)
116 RET_ReallyLR implicit $q0
120 name: rev64_REV64v16i8
123 regBankSelected: true
124 tracksRegLiveness: true
128 ; CHECK-LABEL: name: rev64_REV64v16i8
129 ; CHECK: liveins: $q0
130 ; CHECK: %copy:fpr128 = COPY $q0
131 ; CHECK: %rev:fpr128 = REV64v16i8 %copy
132 ; CHECK: $q0 = COPY %rev
133 ; CHECK: RET_ReallyLR implicit $q0
134 %copy:fpr(<16 x s8>) = COPY $q0
135 %rev:fpr(<16 x s8>) = G_REV64 %copy
136 $q0 = COPY %rev(<16 x s8>)
137 RET_ReallyLR implicit $q0
141 name: rev32_REV32v4i16
144 regBankSelected: true
145 tracksRegLiveness: true
149 ; CHECK-LABEL: name: rev32_REV32v4i16
150 ; CHECK: liveins: $d0
151 ; CHECK: %copy:fpr64 = COPY $d0
152 ; CHECK: %rev:fpr64 = REV32v4i16 %copy
153 ; CHECK: $d0 = COPY %rev
154 ; CHECK: RET_ReallyLR implicit $d0
155 %copy:fpr(<4 x s16>) = COPY $d0
156 %rev:fpr(<4 x s16>) = G_REV32 %copy
157 $d0 = COPY %rev(<4 x s16>)
158 RET_ReallyLR implicit $d0
162 name: rev32_REV32v8i8
165 regBankSelected: true
166 tracksRegLiveness: true
170 ; CHECK-LABEL: name: rev32_REV32v8i8
171 ; CHECK: liveins: $d0
172 ; CHECK: %copy:fpr64 = COPY $d0
173 ; CHECK: %rev:fpr64 = REV32v8i8 %copy
174 ; CHECK: $d0 = COPY %rev
175 ; CHECK: RET_ReallyLR implicit $d0
176 %copy:fpr(<8 x s8>) = COPY $d0
177 %rev:fpr(<8 x s8>) = G_REV32 %copy
178 $d0 = COPY %rev(<8 x s8>)
179 RET_ReallyLR implicit $d0
183 name: rev32_REV32v8i16
186 regBankSelected: true
187 tracksRegLiveness: true
191 ; CHECK-LABEL: name: rev32_REV32v8i16
192 ; CHECK: liveins: $q0
193 ; CHECK: %copy:fpr128 = COPY $q0
194 ; CHECK: %rev:fpr128 = REV32v8i16 %copy
195 ; CHECK: $q0 = COPY %rev
196 ; CHECK: RET_ReallyLR implicit $q0
197 %copy:fpr(<8 x s16>) = COPY $q0
198 %rev:fpr(<8 x s16>) = G_REV32 %copy
199 $q0 = COPY %rev(<8 x s16>)
200 RET_ReallyLR implicit $q0
204 name: rev32_REV32v16i8
207 regBankSelected: true
208 tracksRegLiveness: true
212 ; CHECK-LABEL: name: rev32_REV32v16i8
213 ; CHECK: liveins: $q0
214 ; CHECK: %copy:fpr128 = COPY $q0
215 ; CHECK: %rev:fpr128 = REV32v16i8 %copy
216 ; CHECK: $q0 = COPY %rev
217 ; CHECK: RET_ReallyLR implicit $q0
218 %copy:fpr(<16 x s8>) = COPY $q0
219 %rev:fpr(<16 x s8>) = G_REV32 %copy
220 $q0 = COPY %rev(<16 x s8>)
221 RET_ReallyLR implicit $q0
225 name: rev16_REV16v8i8
228 regBankSelected: true
229 tracksRegLiveness: true
233 ; CHECK-LABEL: name: rev16_REV16v8i8
234 ; CHECK: liveins: $q0
235 ; CHECK: %copy:fpr64 = COPY $d0
236 ; CHECK: %rev:fpr64 = REV16v8i8 %copy
237 ; CHECK: $d0 = COPY %rev
238 ; CHECK: RET_ReallyLR implicit $d0
239 %copy:fpr(<8 x s8>) = COPY $d0
240 %rev:fpr(<8 x s8>) = G_REV16 %copy
241 $d0 = COPY %rev(<8 x s8>)
242 RET_ReallyLR implicit $d0
246 name: rev16_REV16v16i8
249 regBankSelected: true
250 tracksRegLiveness: true
254 ; CHECK-LABEL: name: rev16_REV16v16i8
255 ; CHECK: liveins: $q0
256 ; CHECK: %copy:fpr128 = COPY $q0
257 ; CHECK: %rev:fpr128 = REV16v16i8 %copy
258 ; CHECK: $q0 = COPY %rev
259 ; CHECK: RET_ReallyLR implicit $q0
260 %copy:fpr(<16 x s8>) = COPY $q0
261 %rev:fpr(<16 x s8>) = G_REV16 %copy
262 $q0 = COPY %rev(<16 x s8>)
263 RET_ReallyLR implicit $q0