Skip to content

Commit dbb859a

Browse files
Auto merge of #144987 - tgross35:llvm21-f16-f128, r=<try>
Enable f16 and f128 on targets that were fixed in LLVM21 try-job: dist-i586-gnu-i586-i686-musl try-job: dist-i686-linux try-job: dist-i686-msvc try-job: dist-s390x-linux try-job: dist-various-1 try-job: dist-various-2 try-job: dist-x86_64-linux try-job: i686-gnu-1 try-job: i686-gnu-2 try-job: i686-msvc-1 try-job: i686-msvc-2 try-job: test-various
2 parents dc0bae1 + c38cb12 commit dbb859a

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -371,24 +371,25 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
371371
let target_abi = sess.target.options.abi.as_ref();
372372
let target_pointer_width = sess.target.pointer_width;
373373
let version = get_version();
374+
let lt_20_1_1 = version < (20, 1, 1);
375+
let lt_21_0_0 = version < (21, 0, 0);
374376

375377
cfg.has_reliable_f16 = match (target_arch, target_os) {
376-
// Selection failure <https://github.com/llvm/llvm-project/issues/50374>
377-
("s390x", _) => false,
378-
// LLVM crash without neon <https://github.com/llvm/llvm-project/issues/129394> (now fixed)
378+
// LLVM crash without neon <https://github.com/llvm/llvm-project/issues/129394> (fixed in llvm20)
379379
("aarch64", _)
380-
if !cfg.target_features.iter().any(|f| f.as_str() == "neon")
381-
&& version < (20, 1, 1) =>
380+
if !cfg.target_features.iter().any(|f| f.as_str() == "neon") && lt_20_1_1 =>
382381
{
383382
false
384383
}
385384
// Unsupported <https://github.com/llvm/llvm-project/issues/94434>
386385
("arm64ec", _) => false,
386+
// Selection failure <https://github.com/llvm/llvm-project/issues/50374> (fixed in llvm21)
387+
("s390x", _) if lt_21_0_0 => false,
387388
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
388389
("x86_64", "windows") if target_env == "gnu" && target_abi != "llvm" => false,
389390
// Infinite recursion <https://github.com/llvm/llvm-project/issues/97981>
390391
("csky", _) => false,
391-
("hexagon", _) => false,
392+
("hexagon", _) if lt_21_0_0 => false, // (fixed in llvm21)
392393
("powerpc" | "powerpc64", _) => false,
393394
("sparc" | "sparc64", _) => false,
394395
("wasm32" | "wasm64", _) => false,
@@ -401,10 +402,10 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
401402
cfg.has_reliable_f128 = match (target_arch, target_os) {
402403
// Unsupported <https://github.com/llvm/llvm-project/issues/94434>
403404
("arm64ec", _) => false,
404-
// Selection bug <https://github.com/llvm/llvm-project/issues/96432>
405-
("mips64" | "mips64r6", _) => false,
406-
// Selection bug <https://github.com/llvm/llvm-project/issues/95471>
407-
("nvptx64", _) => false,
405+
// Selection bug <https://github.com/llvm/llvm-project/issues/96432> (fixed in llvm20)
406+
("mips64" | "mips64r6", _) if lt_20_1_1 => false,
407+
// Selection bug <https://github.com/llvm/llvm-project/issues/95471> (fixed in llvm21)
408+
("nvptx64", _) if lt_21_0_0 => false,
408409
// Unsupported https://github.com/llvm/llvm-project/issues/121122
409410
("amdgpu", _) => false,
410411
// ABI bugs <https://github.com/rust-lang/rust/issues/125109> et al. (full
@@ -413,8 +414,8 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
413414
// ABI unsupported <https://github.com/llvm/llvm-project/issues/41838>
414415
("sparc", _) => false,
415416
// Stack alignment bug <https://github.com/llvm/llvm-project/issues/77401>. NB: tests may
416-
// not fail if our compiler-builtins is linked.
417-
("x86", _) => false,
417+
// not fail if our compiler-builtins is linked. (fixed in llvm21)
418+
("x86", _) if lt_21_0_0 => false,
418419
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
419420
("x86_64", "windows") if target_env == "gnu" && target_abi != "llvm" => false,
420421
// There are no known problems on other platforms, so the only requirement is that symbols

0 commit comments

Comments
 (0)