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
18 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
19 ; FP16-NEXT: [[FNEARBYINT:%[0-9]+]]:_(<4 x s16>) = G_FNEARBYINT [[COPY]]
20 ; FP16-NEXT: $d0 = COPY [[FNEARBYINT]](<4 x s16>)
21 ; FP16-NEXT: RET_ReallyLR implicit $d0
23 ; NO-FP16-LABEL: name: test_v4f16.nearbyint
24 ; NO-FP16: liveins: $d0
25 ; NO-FP16-NEXT: {{ $}}
26 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
27 ; NO-FP16-NEXT: [[FPEXT:%[0-9]+]]:_(<4 x s32>) = G_FPEXT [[COPY]](<4 x s16>)
28 ; NO-FP16-NEXT: [[FNEARBYINT:%[0-9]+]]:_(<4 x s32>) = G_FNEARBYINT [[FPEXT]]
29 ; NO-FP16-NEXT: [[FPTRUNC:%[0-9]+]]:_(<4 x s16>) = G_FPTRUNC [[FNEARBYINT]](<4 x s32>)
30 ; NO-FP16-NEXT: $d0 = COPY [[FPTRUNC]](<4 x s16>)
31 ; NO-FP16-NEXT: RET_ReallyLR implicit $d0
32 %0:_(<4 x s16>) = COPY $d0
33 %1:_(<4 x s16>) = G_FNEARBYINT %0
34 $d0 = COPY %1(<4 x s16>)
35 RET_ReallyLR implicit $d0
39 name: test_v8f16.nearbyint
41 tracksRegLiveness: true
42 machineFunctionInfo: {}
47 ; FP16-LABEL: name: test_v8f16.nearbyint
50 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
51 ; FP16-NEXT: [[FNEARBYINT:%[0-9]+]]:_(<8 x s16>) = G_FNEARBYINT [[COPY]]
52 ; FP16-NEXT: $q0 = COPY [[FNEARBYINT]](<8 x s16>)
53 ; FP16-NEXT: RET_ReallyLR implicit $q0
55 ; NO-FP16-LABEL: name: test_v8f16.nearbyint
56 ; NO-FP16: liveins: $q0
57 ; NO-FP16-NEXT: {{ $}}
58 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
59 ; NO-FP16-NEXT: [[UV:%[0-9]+]]:_(<4 x s16>), [[UV1:%[0-9]+]]:_(<4 x s16>) = G_UNMERGE_VALUES [[COPY]](<8 x s16>)
60 ; NO-FP16-NEXT: [[FPEXT:%[0-9]+]]:_(<4 x s32>) = G_FPEXT [[UV]](<4 x s16>)
61 ; NO-FP16-NEXT: [[FPEXT1:%[0-9]+]]:_(<4 x s32>) = G_FPEXT [[UV1]](<4 x s16>)
62 ; NO-FP16-NEXT: [[FNEARBYINT:%[0-9]+]]:_(<4 x s32>) = G_FNEARBYINT [[FPEXT]]
63 ; NO-FP16-NEXT: [[FNEARBYINT1:%[0-9]+]]:_(<4 x s32>) = G_FNEARBYINT [[FPEXT1]]
64 ; NO-FP16-NEXT: [[FPTRUNC:%[0-9]+]]:_(<4 x s16>) = G_FPTRUNC [[FNEARBYINT]](<4 x s32>)
65 ; NO-FP16-NEXT: [[FPTRUNC1:%[0-9]+]]:_(<4 x s16>) = G_FPTRUNC [[FNEARBYINT1]](<4 x s32>)
66 ; NO-FP16-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:_(<8 x s16>) = G_CONCAT_VECTORS [[FPTRUNC]](<4 x s16>), [[FPTRUNC1]](<4 x s16>)
67 ; NO-FP16-NEXT: $q0 = COPY [[CONCAT_VECTORS]](<8 x s16>)
68 ; NO-FP16-NEXT: RET_ReallyLR implicit $q0
69 %0:_(<8 x s16>) = COPY $q0
70 %1:_(<8 x s16>) = G_FNEARBYINT %0
71 $q0 = COPY %1(<8 x s16>)
72 RET_ReallyLR implicit $q0
76 name: test_v2f32.nearbyint
78 tracksRegLiveness: true
79 machineFunctionInfo: {}
84 ; FP16-LABEL: name: test_v2f32.nearbyint
87 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
88 ; FP16-NEXT: [[FNEARBYINT:%[0-9]+]]:_(<2 x s32>) = G_FNEARBYINT [[COPY]]
89 ; FP16-NEXT: $d0 = COPY [[FNEARBYINT]](<2 x s32>)
90 ; FP16-NEXT: RET_ReallyLR implicit $d0
92 ; NO-FP16-LABEL: name: test_v2f32.nearbyint
93 ; NO-FP16: liveins: $d0
94 ; NO-FP16-NEXT: {{ $}}
95 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
96 ; NO-FP16-NEXT: [[FNEARBYINT:%[0-9]+]]:_(<2 x s32>) = G_FNEARBYINT [[COPY]]
97 ; NO-FP16-NEXT: $d0 = COPY [[FNEARBYINT]](<2 x s32>)
98 ; NO-FP16-NEXT: RET_ReallyLR implicit $d0
99 %0:_(<2 x s32>) = COPY $d0
100 %1:_(<2 x s32>) = G_FNEARBYINT %0
101 $d0 = COPY %1(<2 x s32>)
102 RET_ReallyLR implicit $d0
106 name: test_v2f64.nearbyint
108 tracksRegLiveness: true
109 machineFunctionInfo: {}
114 ; FP16-LABEL: name: test_v2f64.nearbyint
117 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
118 ; FP16-NEXT: [[FNEARBYINT:%[0-9]+]]:_(<2 x s64>) = G_FNEARBYINT [[COPY]]
119 ; FP16-NEXT: $q0 = COPY [[FNEARBYINT]](<2 x s64>)
120 ; FP16-NEXT: RET_ReallyLR implicit $q0
122 ; NO-FP16-LABEL: name: test_v2f64.nearbyint
123 ; NO-FP16: liveins: $q0
124 ; NO-FP16-NEXT: {{ $}}
125 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
126 ; NO-FP16-NEXT: [[FNEARBYINT:%[0-9]+]]:_(<2 x s64>) = G_FNEARBYINT [[COPY]]
127 ; NO-FP16-NEXT: $q0 = COPY [[FNEARBYINT]](<2 x s64>)
128 ; NO-FP16-NEXT: RET_ReallyLR implicit $q0
129 %0:_(<2 x s64>) = COPY $q0
130 %1:_(<2 x s64>) = G_FNEARBYINT %0
131 $q0 = COPY %1(<2 x s64>)
132 RET_ReallyLR implicit $q0
136 name: test_f32.nearbyint
138 tracksRegLiveness: true
139 machineFunctionInfo: {}
144 ; FP16-LABEL: name: test_f32.nearbyint
147 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
148 ; FP16-NEXT: [[FNEARBYINT:%[0-9]+]]:_(s32) = G_FNEARBYINT [[COPY]]
149 ; FP16-NEXT: $s0 = COPY [[FNEARBYINT]](s32)
150 ; FP16-NEXT: RET_ReallyLR implicit $s0
152 ; NO-FP16-LABEL: name: test_f32.nearbyint
153 ; NO-FP16: liveins: $s0
154 ; NO-FP16-NEXT: {{ $}}
155 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
156 ; NO-FP16-NEXT: [[FNEARBYINT:%[0-9]+]]:_(s32) = G_FNEARBYINT [[COPY]]
157 ; NO-FP16-NEXT: $s0 = COPY [[FNEARBYINT]](s32)
158 ; NO-FP16-NEXT: RET_ReallyLR implicit $s0
160 %1:_(s32) = G_FNEARBYINT %0
162 RET_ReallyLR implicit $s0
166 name: test_f64.nearbyint
168 tracksRegLiveness: true
169 machineFunctionInfo: {}
174 ; FP16-LABEL: name: test_f64.nearbyint
177 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
178 ; FP16-NEXT: [[FNEARBYINT:%[0-9]+]]:_(s64) = G_FNEARBYINT [[COPY]]
179 ; FP16-NEXT: $d0 = COPY [[FNEARBYINT]](s64)
180 ; FP16-NEXT: RET_ReallyLR implicit $d0
182 ; NO-FP16-LABEL: name: test_f64.nearbyint
183 ; NO-FP16: liveins: $d0
184 ; NO-FP16-NEXT: {{ $}}
185 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
186 ; NO-FP16-NEXT: [[FNEARBYINT:%[0-9]+]]:_(s64) = G_FNEARBYINT [[COPY]]
187 ; NO-FP16-NEXT: $d0 = COPY [[FNEARBYINT]](s64)
188 ; NO-FP16-NEXT: RET_ReallyLR implicit $d0
190 %1:_(s64) = G_FNEARBYINT %0
192 RET_ReallyLR implicit $d0
196 name: test_f16.nearbyint
198 tracksRegLiveness: true
199 machineFunctionInfo: {}
204 ; FP16-LABEL: name: test_f16.nearbyint
207 ; FP16-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
208 ; FP16-NEXT: [[FNEARBYINT:%[0-9]+]]:_(s16) = G_FNEARBYINT [[COPY]]
209 ; FP16-NEXT: $h0 = COPY [[FNEARBYINT]](s16)
210 ; FP16-NEXT: RET_ReallyLR implicit $h0
212 ; NO-FP16-LABEL: name: test_f16.nearbyint
213 ; NO-FP16: liveins: $h0
214 ; NO-FP16-NEXT: {{ $}}
215 ; NO-FP16-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
216 ; NO-FP16-NEXT: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT [[COPY]](s16)
217 ; NO-FP16-NEXT: [[FNEARBYINT:%[0-9]+]]:_(s32) = G_FNEARBYINT [[FPEXT]]
218 ; NO-FP16-NEXT: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[FNEARBYINT]](s32)
219 ; NO-FP16-NEXT: $h0 = COPY [[FPTRUNC]](s16)
220 ; NO-FP16-NEXT: RET_ReallyLR implicit $h0
222 %1:_(s16) = G_FNEARBYINT %0
224 RET_ReallyLR implicit $h0