1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
3 # RUN:llc %s -verify-machineinstrs -mtriple=aarch64-unknown-unknown -run-pass=legalizer -mattr=-fullfp16 -o - | FileCheck %s --check-prefix=NO-FP16
4 # RUN:llc %s -verify-machineinstrs -mtriple=aarch64-unknown-unknown -run-pass=legalizer -mattr=+fullfp16 -o - | FileCheck %s --check-prefix=FP16
10 tracksRegLiveness: true
11 machineFunctionInfo: {}
16 ; NO-FP16-LABEL: name: test_f16.round
17 ; NO-FP16: liveins: $h0
18 ; NO-FP16-NEXT: {{ $}}
19 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
20 ; NO-FP16-NEXT: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT [[COPY]](s16)
21 ; NO-FP16-NEXT: [[INTRINSIC_ROUND:%[0-9]+]]:_(s32) = G_INTRINSIC_ROUND [[FPEXT]]
22 ; NO-FP16-NEXT: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[INTRINSIC_ROUND]](s32)
23 ; NO-FP16-NEXT: $h0 = COPY [[FPTRUNC]](s16)
24 ; NO-FP16-NEXT: RET_ReallyLR implicit $h0
26 ; FP16-LABEL: name: test_f16.round
29 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
30 ; FP16-NEXT: [[INTRINSIC_ROUND:%[0-9]+]]:_(s16) = G_INTRINSIC_ROUND [[COPY]]
31 ; FP16-NEXT: $h0 = COPY [[INTRINSIC_ROUND]](s16)
32 ; FP16-NEXT: RET_ReallyLR implicit $h0
34 %1:_(s16) = G_INTRINSIC_ROUND %0
36 RET_ReallyLR implicit $h0
42 tracksRegLiveness: true
43 machineFunctionInfo: {}
48 ; NO-FP16-LABEL: name: test_f32.round
49 ; NO-FP16: liveins: $s0
50 ; NO-FP16-NEXT: {{ $}}
51 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
52 ; NO-FP16-NEXT: [[INTRINSIC_ROUND:%[0-9]+]]:_(s32) = G_INTRINSIC_ROUND [[COPY]]
53 ; NO-FP16-NEXT: $s0 = COPY [[INTRINSIC_ROUND]](s32)
54 ; NO-FP16-NEXT: RET_ReallyLR implicit $s0
56 ; FP16-LABEL: name: test_f32.round
59 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
60 ; FP16-NEXT: [[INTRINSIC_ROUND:%[0-9]+]]:_(s32) = G_INTRINSIC_ROUND [[COPY]]
61 ; FP16-NEXT: $s0 = COPY [[INTRINSIC_ROUND]](s32)
62 ; FP16-NEXT: RET_ReallyLR implicit $s0
64 %1:_(s32) = G_INTRINSIC_ROUND %0
66 RET_ReallyLR implicit $s0
72 tracksRegLiveness: true
73 machineFunctionInfo: {}
78 ; NO-FP16-LABEL: name: test_f64.round
79 ; NO-FP16: liveins: $d0
80 ; NO-FP16-NEXT: {{ $}}
81 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
82 ; NO-FP16-NEXT: [[INTRINSIC_ROUND:%[0-9]+]]:_(s64) = G_INTRINSIC_ROUND [[COPY]]
83 ; NO-FP16-NEXT: $d0 = COPY [[INTRINSIC_ROUND]](s64)
84 ; NO-FP16-NEXT: RET_ReallyLR implicit $d0
86 ; FP16-LABEL: name: test_f64.round
89 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
90 ; FP16-NEXT: [[INTRINSIC_ROUND:%[0-9]+]]:_(s64) = G_INTRINSIC_ROUND [[COPY]]
91 ; FP16-NEXT: $d0 = COPY [[INTRINSIC_ROUND]](s64)
92 ; FP16-NEXT: RET_ReallyLR implicit $d0
94 %1:_(s64) = G_INTRINSIC_ROUND %0
96 RET_ReallyLR implicit $d0
100 name: test_v8f16.round
102 tracksRegLiveness: true
103 machineFunctionInfo: {}
108 ; NO-FP16-LABEL: name: test_v8f16.round
109 ; NO-FP16: liveins: $q0
110 ; NO-FP16-NEXT: {{ $}}
111 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
112 ; NO-FP16-NEXT: [[UV:%[0-9]+]]:_(<4 x s16>), [[UV1:%[0-9]+]]:_(<4 x s16>) = G_UNMERGE_VALUES [[COPY]](<8 x s16>)
113 ; NO-FP16-NEXT: [[FPEXT:%[0-9]+]]:_(<4 x s32>) = G_FPEXT [[UV]](<4 x s16>)
114 ; NO-FP16-NEXT: [[FPEXT1:%[0-9]+]]:_(<4 x s32>) = G_FPEXT [[UV1]](<4 x s16>)
115 ; NO-FP16-NEXT: [[INTRINSIC_ROUND:%[0-9]+]]:_(<4 x s32>) = G_INTRINSIC_ROUND [[FPEXT]]
116 ; NO-FP16-NEXT: [[INTRINSIC_ROUND1:%[0-9]+]]:_(<4 x s32>) = G_INTRINSIC_ROUND [[FPEXT1]]
117 ; NO-FP16-NEXT: [[FPTRUNC:%[0-9]+]]:_(<4 x s16>) = G_FPTRUNC [[INTRINSIC_ROUND]](<4 x s32>)
118 ; NO-FP16-NEXT: [[FPTRUNC1:%[0-9]+]]:_(<4 x s16>) = G_FPTRUNC [[INTRINSIC_ROUND1]](<4 x s32>)
119 ; NO-FP16-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:_(<8 x s16>) = G_CONCAT_VECTORS [[FPTRUNC]](<4 x s16>), [[FPTRUNC1]](<4 x s16>)
120 ; NO-FP16-NEXT: $q0 = COPY [[CONCAT_VECTORS]](<8 x s16>)
121 ; NO-FP16-NEXT: RET_ReallyLR implicit $q0
123 ; FP16-LABEL: name: test_v8f16.round
126 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
127 ; FP16-NEXT: [[INTRINSIC_ROUND:%[0-9]+]]:_(<8 x s16>) = G_INTRINSIC_ROUND [[COPY]]
128 ; FP16-NEXT: $q0 = COPY [[INTRINSIC_ROUND]](<8 x s16>)
129 ; FP16-NEXT: RET_ReallyLR implicit $q0
130 %0:_(<8 x s16>) = COPY $q0
131 %1:_(<8 x s16>) = G_INTRINSIC_ROUND %0
132 $q0 = COPY %1(<8 x s16>)
133 RET_ReallyLR implicit $q0
137 name: test_v4f16.round
139 tracksRegLiveness: true
141 - { id: 0, class: _ }
142 - { id: 1, class: _ }
143 machineFunctionInfo: {}
148 ; NO-FP16-LABEL: name: test_v4f16.round
149 ; NO-FP16: liveins: $d0
150 ; NO-FP16-NEXT: {{ $}}
151 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
152 ; NO-FP16-NEXT: [[FPEXT:%[0-9]+]]:_(<4 x s32>) = G_FPEXT [[COPY]](<4 x s16>)
153 ; NO-FP16-NEXT: [[INTRINSIC_ROUND:%[0-9]+]]:_(<4 x s32>) = G_INTRINSIC_ROUND [[FPEXT]]
154 ; NO-FP16-NEXT: [[FPTRUNC:%[0-9]+]]:_(<4 x s16>) = G_FPTRUNC [[INTRINSIC_ROUND]](<4 x s32>)
155 ; NO-FP16-NEXT: $d0 = COPY [[FPTRUNC]](<4 x s16>)
156 ; NO-FP16-NEXT: RET_ReallyLR implicit $d0
158 ; FP16-LABEL: name: test_v4f16.round
161 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
162 ; FP16-NEXT: [[INTRINSIC_ROUND:%[0-9]+]]:_(<4 x s16>) = G_INTRINSIC_ROUND [[COPY]]
163 ; FP16-NEXT: $d0 = COPY [[INTRINSIC_ROUND]](<4 x s16>)
164 ; FP16-NEXT: RET_ReallyLR implicit $d0
165 %0:_(<4 x s16>) = COPY $d0
166 %1:_(<4 x s16>) = G_INTRINSIC_ROUND %0
167 $d0 = COPY %1(<4 x s16>)
168 RET_ReallyLR implicit $d0
172 name: test_v2f32.round
174 tracksRegLiveness: true
176 - { id: 0, class: _ }
177 - { id: 1, class: _ }
178 machineFunctionInfo: {}
183 ; NO-FP16-LABEL: name: test_v2f32.round
184 ; NO-FP16: liveins: $d0
185 ; NO-FP16-NEXT: {{ $}}
186 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
187 ; NO-FP16-NEXT: [[INTRINSIC_ROUND:%[0-9]+]]:_(<2 x s32>) = G_INTRINSIC_ROUND [[COPY]]
188 ; NO-FP16-NEXT: $d0 = COPY [[INTRINSIC_ROUND]](<2 x s32>)
189 ; NO-FP16-NEXT: RET_ReallyLR implicit $d0
191 ; FP16-LABEL: name: test_v2f32.round
194 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
195 ; FP16-NEXT: [[INTRINSIC_ROUND:%[0-9]+]]:_(<2 x s32>) = G_INTRINSIC_ROUND [[COPY]]
196 ; FP16-NEXT: $d0 = COPY [[INTRINSIC_ROUND]](<2 x s32>)
197 ; FP16-NEXT: RET_ReallyLR implicit $d0
198 %0:_(<2 x s32>) = COPY $d0
199 %1:_(<2 x s32>) = G_INTRINSIC_ROUND %0
200 $d0 = COPY %1(<2 x s32>)
201 RET_ReallyLR implicit $d0
205 name: test_v4f32.round
207 tracksRegLiveness: true
209 - { id: 0, class: _ }
210 - { id: 1, class: _ }
211 machineFunctionInfo: {}
216 ; NO-FP16-LABEL: name: test_v4f32.round
217 ; NO-FP16: liveins: $q0
218 ; NO-FP16-NEXT: {{ $}}
219 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
220 ; NO-FP16-NEXT: [[INTRINSIC_ROUND:%[0-9]+]]:_(<4 x s32>) = G_INTRINSIC_ROUND [[COPY]]
221 ; NO-FP16-NEXT: $q0 = COPY [[INTRINSIC_ROUND]](<4 x s32>)
222 ; NO-FP16-NEXT: RET_ReallyLR implicit $q0
224 ; FP16-LABEL: name: test_v4f32.round
227 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
228 ; FP16-NEXT: [[INTRINSIC_ROUND:%[0-9]+]]:_(<4 x s32>) = G_INTRINSIC_ROUND [[COPY]]
229 ; FP16-NEXT: $q0 = COPY [[INTRINSIC_ROUND]](<4 x s32>)
230 ; FP16-NEXT: RET_ReallyLR implicit $q0
231 %0:_(<4 x s32>) = COPY $q0
232 %1:_(<4 x s32>) = G_INTRINSIC_ROUND %0
233 $q0 = COPY %1(<4 x s32>)
234 RET_ReallyLR implicit $q0
238 name: test_v2f64.round
240 tracksRegLiveness: true
242 - { id: 0, class: _ }
243 - { id: 1, class: _ }
244 machineFunctionInfo: {}
249 ; NO-FP16-LABEL: name: test_v2f64.round
250 ; NO-FP16: liveins: $q0
251 ; NO-FP16-NEXT: {{ $}}
252 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
253 ; NO-FP16-NEXT: [[INTRINSIC_ROUND:%[0-9]+]]:_(<2 x s64>) = G_INTRINSIC_ROUND [[COPY]]
254 ; NO-FP16-NEXT: $q0 = COPY [[INTRINSIC_ROUND]](<2 x s64>)
255 ; NO-FP16-NEXT: RET_ReallyLR implicit $q0
257 ; FP16-LABEL: name: test_v2f64.round
260 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
261 ; FP16-NEXT: [[INTRINSIC_ROUND:%[0-9]+]]:_(<2 x s64>) = G_INTRINSIC_ROUND [[COPY]]
262 ; FP16-NEXT: $q0 = COPY [[INTRINSIC_ROUND]](<2 x s64>)
263 ; FP16-NEXT: RET_ReallyLR implicit $q0
264 %0:_(<2 x s64>) = COPY $q0
265 %1:_(<2 x s64>) = G_INTRINSIC_ROUND %0
266 $q0 = COPY %1(<2 x s64>)
267 RET_ReallyLR implicit $q0