@@ -109,16 +109,6 @@ intrinsics! {
109
109
}
110
110
}
111
111
112
- #[ unadjusted_on_win64]
113
- pub extern "C" fn __floattisf( i: i128 ) -> f32 {
114
- int_to_float( i)
115
- }
116
-
117
- #[ unadjusted_on_win64]
118
- pub extern "C" fn __floattidf( i: i128 ) -> f64 {
119
- int_to_float( i)
120
- }
121
-
122
112
#[ arm_aeabi_alias = __aeabi_ui2f]
123
113
pub extern "C" fn __floatunsisf( i: u32 ) -> f32 {
124
114
int_to_float( i)
@@ -140,16 +130,6 @@ intrinsics! {
140
130
pub extern "C" fn __floatundidf( i: u64 ) -> f64 {
141
131
int_to_float( i)
142
132
}
143
-
144
- #[ unadjusted_on_win64]
145
- pub extern "C" fn __floatuntisf( i: u128 ) -> f32 {
146
- int_to_float( i)
147
- }
148
-
149
- #[ unadjusted_on_win64]
150
- pub extern "C" fn __floatuntidf( i: u128 ) -> f64 {
151
- int_to_float( i)
152
- }
153
133
}
154
134
155
135
fn float_to_int < F : Float , I : Int > ( f : F ) -> I
@@ -224,11 +204,6 @@ intrinsics! {
224
204
float_to_int( f)
225
205
}
226
206
227
- #[ unadjusted_on_win64]
228
- pub extern "C" fn __fixsfti( f: f32 ) -> i128 {
229
- float_to_int( f)
230
- }
231
-
232
207
#[ arm_aeabi_alias = __aeabi_d2iz]
233
208
pub extern "C" fn __fixdfsi( f: f64 ) -> i32 {
234
209
float_to_int( f)
@@ -239,11 +214,6 @@ intrinsics! {
239
214
float_to_int( f)
240
215
}
241
216
242
- #[ unadjusted_on_win64]
243
- pub extern "C" fn __fixdfti( f: f64 ) -> i128 {
244
- float_to_int( f)
245
- }
246
-
247
217
#[ arm_aeabi_alias = __aeabi_f2uiz]
248
218
pub extern "C" fn __fixunssfsi( f: f32 ) -> u32 {
249
219
float_to_int( f)
@@ -254,11 +224,6 @@ intrinsics! {
254
224
float_to_int( f)
255
225
}
256
226
257
- #[ unadjusted_on_win64]
258
- pub extern "C" fn __fixunssfti( f: f32 ) -> u128 {
259
- float_to_int( f)
260
- }
261
-
262
227
#[ arm_aeabi_alias = __aeabi_d2uiz]
263
228
pub extern "C" fn __fixunsdfsi( f: f64 ) -> u32 {
264
229
float_to_int( f)
@@ -268,6 +233,87 @@ intrinsics! {
268
233
pub extern "C" fn __fixunsdfdi( f: f64 ) -> u64 {
269
234
float_to_int( f)
270
235
}
236
+ }
237
+
238
+ // The ABI for the following intrinsics changed in LLVM 14. On Win64, they now
239
+ // use Win64 ABI rather than unadjusted ABI. Pick the correct ABI based on the
240
+ // llvm14-builtins-abi target feature.
241
+
242
+ #[ cfg( target_feature = "llvm14-builtins-abi" ) ]
243
+ intrinsics ! {
244
+ pub extern "C" fn __floattisf( i: i128 ) -> f32 {
245
+ int_to_float( i)
246
+ }
247
+
248
+ pub extern "C" fn __floattidf( i: i128 ) -> f64 {
249
+ int_to_float( i)
250
+ }
251
+
252
+ pub extern "C" fn __floatuntisf( i: u128 ) -> f32 {
253
+ int_to_float( i)
254
+ }
255
+
256
+ pub extern "C" fn __floatuntidf( i: u128 ) -> f64 {
257
+ int_to_float( i)
258
+ }
259
+
260
+ #[ win64_128bit_abi_hack]
261
+ pub extern "C" fn __fixsfti( f: f32 ) -> i128 {
262
+ float_to_int( f)
263
+ }
264
+
265
+ #[ win64_128bit_abi_hack]
266
+ pub extern "C" fn __fixdfti( f: f64 ) -> i128 {
267
+ float_to_int( f)
268
+ }
269
+
270
+ #[ win64_128bit_abi_hack]
271
+ pub extern "C" fn __fixunssfti( f: f32 ) -> u128 {
272
+ float_to_int( f)
273
+ }
274
+
275
+ #[ win64_128bit_abi_hack]
276
+ pub extern "C" fn __fixunsdfti( f: f64 ) -> u128 {
277
+ float_to_int( f)
278
+ }
279
+ }
280
+
281
+ #[ cfg( not( target_feature = "llvm14-builtins-abi" ) ) ]
282
+ intrinsics ! {
283
+ #[ unadjusted_on_win64]
284
+ pub extern "C" fn __floattisf( i: i128 ) -> f32 {
285
+ int_to_float( i)
286
+ }
287
+
288
+ #[ unadjusted_on_win64]
289
+ pub extern "C" fn __floattidf( i: i128 ) -> f64 {
290
+ int_to_float( i)
291
+ }
292
+
293
+ #[ unadjusted_on_win64]
294
+ pub extern "C" fn __floatuntisf( i: u128 ) -> f32 {
295
+ int_to_float( i)
296
+ }
297
+
298
+ #[ unadjusted_on_win64]
299
+ pub extern "C" fn __floatuntidf( i: u128 ) -> f64 {
300
+ int_to_float( i)
301
+ }
302
+
303
+ #[ unadjusted_on_win64]
304
+ pub extern "C" fn __fixsfti( f: f32 ) -> i128 {
305
+ float_to_int( f)
306
+ }
307
+
308
+ #[ unadjusted_on_win64]
309
+ pub extern "C" fn __fixdfti( f: f64 ) -> i128 {
310
+ float_to_int( f)
311
+ }
312
+
313
+ #[ unadjusted_on_win64]
314
+ pub extern "C" fn __fixunssfti( f: f32 ) -> u128 {
315
+ float_to_int( f)
316
+ }
271
317
272
318
#[ unadjusted_on_win64]
273
319
pub extern "C" fn __fixunsdfti( f: f64 ) -> u128 {
0 commit comments