@@ -217,6 +217,14 @@ mod c {
217217 }
218218 }
219219
220+ // `compiler-rt` requires `COMPILER_RT_HAS_FLOAT16` to be defined to make it use the
221+ // `_Float16` type for `f16` intrinsics. This shouldn't matter as all existing `f16`
222+ // intrinsics have been ported to Rust in `compiler-builtins` as C compilers don't
223+ // support `_Float16` on all targets (whereas Rust does). However, define the macro
224+ // anyway to prevent issues like rust#118813 and rust#123885 silently reoccuring if more
225+ // `f16` intrinsics get accidentally added here in the future.
226+ cfg. define ( "COMPILER_RT_HAS_FLOAT16" , None ) ;
227+
220228 cfg. warnings ( false ) ;
221229
222230 if target_env == "msvc" {
@@ -288,13 +296,10 @@ mod c {
288296 sources. extend ( & [
289297 ( "__divdc3" , "divdc3.c" ) ,
290298 ( "__divsc3" , "divsc3.c" ) ,
291- ( "__extendhfsf2" , "extendhfsf2.c" ) ,
292299 ( "__muldc3" , "muldc3.c" ) ,
293300 ( "__mulsc3" , "mulsc3.c" ) ,
294301 ( "__negdf2" , "negdf2.c" ) ,
295302 ( "__negsf2" , "negsf2.c" ) ,
296- ( "__truncdfhf2" , "truncdfhf2.c" ) ,
297- ( "__truncsfhf2" , "truncsfhf2.c" ) ,
298303 ] ) ;
299304 }
300305
@@ -464,8 +469,6 @@ mod c {
464469 if ( target_arch == "aarch64" || target_arch == "arm64ec" ) && consider_float_intrinsics {
465470 sources. extend ( & [
466471 ( "__comparetf2" , "comparetf2.c" ) ,
467- ( "__extenddftf2" , "extenddftf2.c" ) ,
468- ( "__extendsftf2" , "extendsftf2.c" ) ,
469472 ( "__fixtfdi" , "fixtfdi.c" ) ,
470473 ( "__fixtfsi" , "fixtfsi.c" ) ,
471474 ( "__fixtfti" , "fixtfti.c" ) ,
@@ -476,8 +479,6 @@ mod c {
476479 ( "__floatsitf" , "floatsitf.c" ) ,
477480 ( "__floatunditf" , "floatunditf.c" ) ,
478481 ( "__floatunsitf" , "floatunsitf.c" ) ,
479- ( "__trunctfdf2" , "trunctfdf2.c" ) ,
480- ( "__trunctfsf2" , "trunctfsf2.c" ) ,
481482 ( "__addtf3" , "addtf3.c" ) ,
482483 ( "__multf3" , "multf3.c" ) ,
483484 ( "__subtf3" , "subtf3.c" ) ,
@@ -498,7 +499,6 @@ mod c {
498499
499500 if target_arch == "mips64" {
500501 sources. extend ( & [
501- ( "__extenddftf2" , "extenddftf2.c" ) ,
502502 ( "__netf2" , "comparetf2.c" ) ,
503503 ( "__addtf3" , "addtf3.c" ) ,
504504 ( "__multf3" , "multf3.c" ) ,
@@ -509,14 +509,11 @@ mod c {
509509 ( "__floatunsitf" , "floatunsitf.c" ) ,
510510 ( "__fe_getround" , "fp_mode.c" ) ,
511511 ( "__divtf3" , "divtf3.c" ) ,
512- ( "__trunctfdf2" , "trunctfdf2.c" ) ,
513- ( "__trunctfsf2" , "trunctfsf2.c" ) ,
514512 ] ) ;
515513 }
516514
517515 if target_arch == "loongarch64" {
518516 sources. extend ( & [
519- ( "__extenddftf2" , "extenddftf2.c" ) ,
520517 ( "__netf2" , "comparetf2.c" ) ,
521518 ( "__addtf3" , "addtf3.c" ) ,
522519 ( "__multf3" , "multf3.c" ) ,
@@ -527,8 +524,6 @@ mod c {
527524 ( "__floatunsitf" , "floatunsitf.c" ) ,
528525 ( "__fe_getround" , "fp_mode.c" ) ,
529526 ( "__divtf3" , "divtf3.c" ) ,
530- ( "__trunctfdf2" , "trunctfdf2.c" ) ,
531- ( "__trunctfsf2" , "trunctfsf2.c" ) ,
532527 ] ) ;
533528 }
534529
0 commit comments