rustc_target: Remove fpmr target feature

FEAT_FPMR has been removed from upstream LLVM as of LLVM 19.
Remove the feature from the target features list and temporarily hack
the LLVM codegen to always enable it until the minimum LLVM version is
bumped to 19.
This commit is contained in:
Kajetan Puchalski 2024-07-29 13:08:31 +01:00
parent c3518067c7
commit 4fc4019cbc
2 changed files with 6 additions and 2 deletions

View File

@ -528,6 +528,12 @@ pub(crate) fn llfn_attrs_from_instance<'ll, 'tcx>(
InstructionSetAttr::ArmA32 => "-thumb-mode".to_string(),
InstructionSetAttr::ArmT32 => "+thumb-mode".to_string(),
}))
// HACK: LLVM versions 19+ do not have the FPMR feature and treat it as always enabled
// It only exists as a feature in LLVM 18, cannot be passed down for any other version
.chain(match &*cx.tcx.sess.target.arch {
"aarch64" if llvm_util::get_version().0 == 18 => vec!["+fpmr".to_string()],
_ => vec![],
})
.collect::<Vec<String>>();
if cx.tcx.sess.target.is_like_wasm {

View File

@ -136,8 +136,6 @@ const AARCH64_ALLOWED_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
("fp8dot4", Unstable(sym::aarch64_unstable_target_feature), &["fp8fma"]),
// FEAT_FP8FMA
("fp8fma", Unstable(sym::aarch64_unstable_target_feature), &["fp8"]),
// FEAT_FPMR
("fpmr", Unstable(sym::aarch64_unstable_target_feature), &[]),
// FEAT_FRINTTS
("frintts", Stable, &[]),
// FEAT_HBC