1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64-unknown-unknown -run-pass=legalizer -mattr=+fullfp16 -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=FP16
3 # RUN: llc -mtriple aarch64-unknown-unknown -run-pass=legalizer -mattr=-fullfp16 -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=NO-FP16
7 name: test_v4f16.nearbyint
9 tracksRegLiveness: true
10 machineFunctionInfo: {}
15 ; FP16-LABEL: name: test_v4f16.nearbyint
17 ; FP16: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
18 ; FP16: [[FNEARBYINT:%[0-9]+]]:_(<4 x s16>) = G_FNEARBYINT [[COPY]]
19 ; FP16: $d0 = COPY [[FNEARBYINT]](<4 x s16>)
20 ; FP16: RET_ReallyLR implicit $d0
21 ; NO-FP16-LABEL: name: test_v4f16.nearbyint
22 ; NO-FP16: liveins: $d0
23 ; NO-FP16: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
24 ; NO-FP16: [[UV:%[0-9]+]]:_(s16), [[UV1:%[0-9]+]]:_(s16), [[UV2:%[0-9]+]]:_(s16), [[UV3:%[0-9]+]]:_(s16) = G_UNMERGE_VALUES [[COPY]](<4 x s16>)
25 ; NO-FP16: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT [[UV]](s16)
26 ; NO-FP16: [[FNEARBYINT:%[0-9]+]]:_(s32) = G_FNEARBYINT [[FPEXT]]
27 ; NO-FP16: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[FNEARBYINT]](s32)
28 ; NO-FP16: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT [[UV1]](s16)
29 ; NO-FP16: [[FNEARBYINT1:%[0-9]+]]:_(s32) = G_FNEARBYINT [[FPEXT1]]
30 ; NO-FP16: [[FPTRUNC1:%[0-9]+]]:_(s16) = G_FPTRUNC [[FNEARBYINT1]](s32)
31 ; NO-FP16: [[FPEXT2:%[0-9]+]]:_(s32) = G_FPEXT [[UV2]](s16)
32 ; NO-FP16: [[FNEARBYINT2:%[0-9]+]]:_(s32) = G_FNEARBYINT [[FPEXT2]]
33 ; NO-FP16: [[FPTRUNC2:%[0-9]+]]:_(s16) = G_FPTRUNC [[FNEARBYINT2]](s32)
34 ; NO-FP16: [[FPEXT3:%[0-9]+]]:_(s32) = G_FPEXT [[UV3]](s16)
35 ; NO-FP16: [[FNEARBYINT3:%[0-9]+]]:_(s32) = G_FNEARBYINT [[FPEXT3]]
36 ; NO-FP16: [[FPTRUNC3:%[0-9]+]]:_(s16) = G_FPTRUNC [[FNEARBYINT3]](s32)
37 ; NO-FP16: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s16>) = G_BUILD_VECTOR [[FPTRUNC]](s16), [[FPTRUNC1]](s16), [[FPTRUNC2]](s16), [[FPTRUNC3]](s16)
38 ; NO-FP16: $d0 = COPY [[BUILD_VECTOR]](<4 x s16>)
39 ; NO-FP16: RET_ReallyLR implicit $d0
40 %0:_(<4 x s16>) = COPY $d0
41 %1:_(<4 x s16>) = G_FNEARBYINT %0
42 $d0 = COPY %1(<4 x s16>)
43 RET_ReallyLR implicit $d0
47 name: test_v8f16.nearbyint
49 tracksRegLiveness: true
50 machineFunctionInfo: {}
55 ; FP16-LABEL: name: test_v8f16.nearbyint
57 ; FP16: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
58 ; FP16: [[FNEARBYINT:%[0-9]+]]:_(<8 x s16>) = G_FNEARBYINT [[COPY]]
59 ; FP16: $q0 = COPY [[FNEARBYINT]](<8 x s16>)
60 ; FP16: RET_ReallyLR implicit $q0
61 ; NO-FP16-LABEL: name: test_v8f16.nearbyint
62 ; NO-FP16: liveins: $q0
63 ; NO-FP16: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
64 ; NO-FP16: [[UV:%[0-9]+]]:_(s16), [[UV1:%[0-9]+]]:_(s16), [[UV2:%[0-9]+]]:_(s16), [[UV3:%[0-9]+]]:_(s16), [[UV4:%[0-9]+]]:_(s16), [[UV5:%[0-9]+]]:_(s16), [[UV6:%[0-9]+]]:_(s16), [[UV7:%[0-9]+]]:_(s16) = G_UNMERGE_VALUES [[COPY]](<8 x s16>)
65 ; NO-FP16: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT [[UV]](s16)
66 ; NO-FP16: [[FNEARBYINT:%[0-9]+]]:_(s32) = G_FNEARBYINT [[FPEXT]]
67 ; NO-FP16: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[FNEARBYINT]](s32)
68 ; NO-FP16: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT [[UV1]](s16)
69 ; NO-FP16: [[FNEARBYINT1:%[0-9]+]]:_(s32) = G_FNEARBYINT [[FPEXT1]]
70 ; NO-FP16: [[FPTRUNC1:%[0-9]+]]:_(s16) = G_FPTRUNC [[FNEARBYINT1]](s32)
71 ; NO-FP16: [[FPEXT2:%[0-9]+]]:_(s32) = G_FPEXT [[UV2]](s16)
72 ; NO-FP16: [[FNEARBYINT2:%[0-9]+]]:_(s32) = G_FNEARBYINT [[FPEXT2]]
73 ; NO-FP16: [[FPTRUNC2:%[0-9]+]]:_(s16) = G_FPTRUNC [[FNEARBYINT2]](s32)
74 ; NO-FP16: [[FPEXT3:%[0-9]+]]:_(s32) = G_FPEXT [[UV3]](s16)
75 ; NO-FP16: [[FNEARBYINT3:%[0-9]+]]:_(s32) = G_FNEARBYINT [[FPEXT3]]
76 ; NO-FP16: [[FPTRUNC3:%[0-9]+]]:_(s16) = G_FPTRUNC [[FNEARBYINT3]](s32)
77 ; NO-FP16: [[FPEXT4:%[0-9]+]]:_(s32) = G_FPEXT [[UV4]](s16)
78 ; NO-FP16: [[FNEARBYINT4:%[0-9]+]]:_(s32) = G_FNEARBYINT [[FPEXT4]]
79 ; NO-FP16: [[FPTRUNC4:%[0-9]+]]:_(s16) = G_FPTRUNC [[FNEARBYINT4]](s32)
80 ; NO-FP16: [[FPEXT5:%[0-9]+]]:_(s32) = G_FPEXT [[UV5]](s16)
81 ; NO-FP16: [[FNEARBYINT5:%[0-9]+]]:_(s32) = G_FNEARBYINT [[FPEXT5]]
82 ; NO-FP16: [[FPTRUNC5:%[0-9]+]]:_(s16) = G_FPTRUNC [[FNEARBYINT5]](s32)
83 ; NO-FP16: [[FPEXT6:%[0-9]+]]:_(s32) = G_FPEXT [[UV6]](s16)
84 ; NO-FP16: [[FNEARBYINT6:%[0-9]+]]:_(s32) = G_FNEARBYINT [[FPEXT6]]
85 ; NO-FP16: [[FPTRUNC6:%[0-9]+]]:_(s16) = G_FPTRUNC [[FNEARBYINT6]](s32)
86 ; NO-FP16: [[FPEXT7:%[0-9]+]]:_(s32) = G_FPEXT [[UV7]](s16)
87 ; NO-FP16: [[FNEARBYINT7:%[0-9]+]]:_(s32) = G_FNEARBYINT [[FPEXT7]]
88 ; NO-FP16: [[FPTRUNC7:%[0-9]+]]:_(s16) = G_FPTRUNC [[FNEARBYINT7]](s32)
89 ; NO-FP16: [[BUILD_VECTOR:%[0-9]+]]:_(<8 x s16>) = G_BUILD_VECTOR [[FPTRUNC]](s16), [[FPTRUNC1]](s16), [[FPTRUNC2]](s16), [[FPTRUNC3]](s16), [[FPTRUNC4]](s16), [[FPTRUNC5]](s16), [[FPTRUNC6]](s16), [[FPTRUNC7]](s16)
90 ; NO-FP16: $q0 = COPY [[BUILD_VECTOR]](<8 x s16>)
91 ; NO-FP16: RET_ReallyLR implicit $q0
92 %0:_(<8 x s16>) = COPY $q0
93 %1:_(<8 x s16>) = G_FNEARBYINT %0
94 $q0 = COPY %1(<8 x s16>)
95 RET_ReallyLR implicit $q0
99 name: test_v2f32.nearbyint
101 tracksRegLiveness: true
102 machineFunctionInfo: {}
107 ; FP16-LABEL: name: test_v2f32.nearbyint
109 ; FP16: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
110 ; FP16: [[FNEARBYINT:%[0-9]+]]:_(<2 x s32>) = G_FNEARBYINT [[COPY]]
111 ; FP16: $d0 = COPY [[FNEARBYINT]](<2 x s32>)
112 ; FP16: RET_ReallyLR implicit $d0
113 ; NO-FP16-LABEL: name: test_v2f32.nearbyint
114 ; NO-FP16: liveins: $d0
115 ; NO-FP16: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
116 ; NO-FP16: [[FNEARBYINT:%[0-9]+]]:_(<2 x s32>) = G_FNEARBYINT [[COPY]]
117 ; NO-FP16: $d0 = COPY [[FNEARBYINT]](<2 x s32>)
118 ; NO-FP16: RET_ReallyLR implicit $d0
119 %0:_(<2 x s32>) = COPY $d0
120 %1:_(<2 x s32>) = G_FNEARBYINT %0
121 $d0 = COPY %1(<2 x s32>)
122 RET_ReallyLR implicit $d0
126 name: test_v2f64.nearbyint
128 tracksRegLiveness: true
129 machineFunctionInfo: {}
134 ; FP16-LABEL: name: test_v2f64.nearbyint
136 ; FP16: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
137 ; FP16: [[FNEARBYINT:%[0-9]+]]:_(<2 x s64>) = G_FNEARBYINT [[COPY]]
138 ; FP16: $q0 = COPY [[FNEARBYINT]](<2 x s64>)
139 ; FP16: RET_ReallyLR implicit $q0
140 ; NO-FP16-LABEL: name: test_v2f64.nearbyint
141 ; NO-FP16: liveins: $q0
142 ; NO-FP16: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
143 ; NO-FP16: [[FNEARBYINT:%[0-9]+]]:_(<2 x s64>) = G_FNEARBYINT [[COPY]]
144 ; NO-FP16: $q0 = COPY [[FNEARBYINT]](<2 x s64>)
145 ; NO-FP16: RET_ReallyLR implicit $q0
146 %0:_(<2 x s64>) = COPY $q0
147 %1:_(<2 x s64>) = G_FNEARBYINT %0
148 $q0 = COPY %1(<2 x s64>)
149 RET_ReallyLR implicit $q0
153 name: test_f32.nearbyint
155 tracksRegLiveness: true
156 machineFunctionInfo: {}
161 ; FP16-LABEL: name: test_f32.nearbyint
163 ; FP16: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
164 ; FP16: [[FNEARBYINT:%[0-9]+]]:_(s32) = G_FNEARBYINT [[COPY]]
165 ; FP16: $s0 = COPY [[FNEARBYINT]](s32)
166 ; FP16: RET_ReallyLR implicit $s0
167 ; NO-FP16-LABEL: name: test_f32.nearbyint
168 ; NO-FP16: liveins: $s0
169 ; NO-FP16: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
170 ; NO-FP16: [[FNEARBYINT:%[0-9]+]]:_(s32) = G_FNEARBYINT [[COPY]]
171 ; NO-FP16: $s0 = COPY [[FNEARBYINT]](s32)
172 ; NO-FP16: RET_ReallyLR implicit $s0
174 %1:_(s32) = G_FNEARBYINT %0
176 RET_ReallyLR implicit $s0
180 name: test_f64.nearbyint
182 tracksRegLiveness: true
183 machineFunctionInfo: {}
188 ; FP16-LABEL: name: test_f64.nearbyint
190 ; FP16: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
191 ; FP16: [[FNEARBYINT:%[0-9]+]]:_(s64) = G_FNEARBYINT [[COPY]]
192 ; FP16: $d0 = COPY [[FNEARBYINT]](s64)
193 ; FP16: RET_ReallyLR implicit $d0
194 ; NO-FP16-LABEL: name: test_f64.nearbyint
195 ; NO-FP16: liveins: $d0
196 ; NO-FP16: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
197 ; NO-FP16: [[FNEARBYINT:%[0-9]+]]:_(s64) = G_FNEARBYINT [[COPY]]
198 ; NO-FP16: $d0 = COPY [[FNEARBYINT]](s64)
199 ; NO-FP16: RET_ReallyLR implicit $d0
201 %1:_(s64) = G_FNEARBYINT %0
203 RET_ReallyLR implicit $d0
207 name: test_f16.nearbyint
209 tracksRegLiveness: true
210 machineFunctionInfo: {}
215 ; FP16-LABEL: name: test_f16.nearbyint
217 ; FP16: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
218 ; FP16: [[FNEARBYINT:%[0-9]+]]:_(s16) = G_FNEARBYINT [[COPY]]
219 ; FP16: $h0 = COPY [[FNEARBYINT]](s16)
220 ; FP16: RET_ReallyLR implicit $h0
221 ; NO-FP16-LABEL: name: test_f16.nearbyint
222 ; NO-FP16: liveins: $h0
223 ; NO-FP16: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
224 ; NO-FP16: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT [[COPY]](s16)
225 ; NO-FP16: [[FNEARBYINT:%[0-9]+]]:_(s32) = G_FNEARBYINT [[FPEXT]]
226 ; NO-FP16: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[FNEARBYINT]](s32)
227 ; NO-FP16: $h0 = COPY [[FPTRUNC]](s16)
228 ; NO-FP16: RET_ReallyLR implicit $h0
230 %1:_(s16) = G_FNEARBYINT %0
232 RET_ReallyLR implicit $h0