Skip to content

Commit 91db833

Browse files
authored
Unrolled build for #144987
Rollup merge of #144987 - tgross35:llvm21-f16-f128, r=nikic Enable f16 and f128 on targets that were fixed in LLVM21 LLVM21 fixed the new float types on a number of targets: * SystemZ gained f16 support llvm/llvm-project#109164 * Hexagon now uses soft f16 to avoid recursion bugs llvm/llvm-project#130977 * Mips now correctly handles f128 (actually since LLVM20) llvm/llvm-project#117525 * f128 is now correctly aligned when passing the stack on x86 llvm/llvm-project#138092 Thus, enable the types on relevant targets for LLVM > 21.0.0. NVPTX also gained handling of f128 as a storage type, but it lacks support for basic math operations so is still disabled here. 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 de3efa7 + cdb299c commit 91db833

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -377,24 +377,25 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
377377
let target_abi = sess.target.options.abi.as_ref();
378378
let target_pointer_width = sess.target.pointer_width;
379379
let version = get_version();
380+
let lt_20_1_1 = version < (20, 1, 1);
381+
let lt_21_0_0 = version < (21, 0, 0);
380382

381383
cfg.has_reliable_f16 = match (target_arch, target_os) {
382-
// Selection failure <https://github.com/llvm/llvm-project/issues/50374>
383-
("s390x", _) => false,
384-
// LLVM crash without neon <https://github.com/llvm/llvm-project/issues/129394> (now fixed)
384+
// LLVM crash without neon <https://github.com/llvm/llvm-project/issues/129394> (fixed in llvm20)
385385
("aarch64", _)
386-
if !cfg.target_features.iter().any(|f| f.as_str() == "neon")
387-
&& version < (20, 1, 1) =>
386+
if !cfg.target_features.iter().any(|f| f.as_str() == "neon") && lt_20_1_1 =>
388387
{
389388
false
390389
}
391390
// Unsupported <https://github.com/llvm/llvm-project/issues/94434>
392391
("arm64ec", _) => false,
392+
// Selection failure <https://github.com/llvm/llvm-project/issues/50374> (fixed in llvm21)
393+
("s390x", _) if lt_21_0_0 => false,
393394
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
394395
("x86_64", "windows") if target_env == "gnu" && target_abi != "llvm" => false,
395396
// Infinite recursion <https://github.com/llvm/llvm-project/issues/97981>
396397
("csky", _) => false,
397-
("hexagon", _) => false,
398+
("hexagon", _) if lt_21_0_0 => false, // (fixed in llvm21)
398399
("powerpc" | "powerpc64", _) => false,
399400
("sparc" | "sparc64", _) => false,
400401
("wasm32" | "wasm64", _) => false,
@@ -407,9 +408,10 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
407408
cfg.has_reliable_f128 = match (target_arch, target_os) {
408409
// Unsupported <https://github.com/llvm/llvm-project/issues/94434>
409410
("arm64ec", _) => false,
410-
// Selection bug <https://github.com/llvm/llvm-project/issues/96432>
411-
("mips64" | "mips64r6", _) => false,
412-
// Selection bug <https://github.com/llvm/llvm-project/issues/95471>
411+
// Selection bug <https://github.com/llvm/llvm-project/issues/96432> (fixed in llvm20)
412+
("mips64" | "mips64r6", _) if lt_20_1_1 => false,
413+
// Selection bug <https://github.com/llvm/llvm-project/issues/95471>. This issue is closed
414+
// but basic math still does not work.
413415
("nvptx64", _) => false,
414416
// Unsupported https://github.com/llvm/llvm-project/issues/121122
415417
("amdgpu", _) => false,
@@ -419,8 +421,8 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
419421
// ABI unsupported <https://github.com/llvm/llvm-project/issues/41838>
420422
("sparc", _) => false,
421423
// Stack alignment bug <https://github.com/llvm/llvm-project/issues/77401>. NB: tests may
422-
// not fail if our compiler-builtins is linked.
423-
("x86", _) => false,
424+
// not fail if our compiler-builtins is linked. (fixed in llvm21)
425+
("x86", _) if lt_21_0_0 => false,
424426
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
425427
("x86_64", "windows") if target_env == "gnu" && target_abi != "llvm" => false,
426428
// There are no known problems on other platforms, so the only requirement is that symbols

0 commit comments

Comments
 (0)