Skip to content

Commit 1ea80ce

Browse files
Added apxf target feature support, under flag apx_target_feature
1 parent 99b5a86 commit 1ea80ce

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

+29
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,35 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
297297
None
298298
}
299299
("x86", "movrs") if get_version().0 < 20 => None,
300+
("x86", "apxf") => {
301+
if get_version() < (18, 1, 0) {
302+
None
303+
} else if get_version() < (19, 1, 0) {
304+
Some(LLVMFeature::with_dependencies(
305+
"egpr",
306+
smallvec![
307+
TargetFeatureFoldStrength::Both("push2pop2"),
308+
TargetFeatureFoldStrength::Both("ppx"),
309+
TargetFeatureFoldStrength::Both("ndd"),
310+
TargetFeatureFoldStrength::Both("ccmp"),
311+
TargetFeatureFoldStrength::Both("cf"),
312+
],
313+
))
314+
} else {
315+
Some(LLVMFeature::with_dependencies(
316+
"egpr",
317+
smallvec![
318+
TargetFeatureFoldStrength::Both("push2pop2"),
319+
TargetFeatureFoldStrength::Both("ppx"),
320+
TargetFeatureFoldStrength::Both("ndd"),
321+
TargetFeatureFoldStrength::Both("ccmp"),
322+
TargetFeatureFoldStrength::Both("cf"),
323+
TargetFeatureFoldStrength::Both("nf"),
324+
TargetFeatureFoldStrength::Both("zu"),
325+
],
326+
))
327+
}
328+
}
300329
(_, s) => Some(LLVMFeature::new(s)),
301330
}
302331
}

compiler/rustc_feature/src/unstable.rs

+1
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ declare_features! (
314314
// Unstable `#[target_feature]` directives.
315315
(unstable, aarch64_unstable_target_feature, "1.82.0", Some(44839)),
316316
(unstable, aarch64_ver_target_feature, "1.27.0", Some(44839)),
317+
(unstable, apx_target_feature, "CURRENT_RUSTC_VERSION", Some(139284)),
317318
(unstable, arm_target_feature, "1.27.0", Some(44839)),
318319
(unstable, avx512_target_feature, "1.27.0", Some(44839)),
319320
(unstable, bpf_target_feature, "1.54.0", Some(44839)),

compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ symbols! {
457457
anonymous_lifetime_in_impl_trait,
458458
any,
459459
append_const_msg,
460+
apx_target_feature,
460461
arbitrary_enum_discriminant,
461462
arbitrary_self_types,
462463
arbitrary_self_types_pointers,

compiler/rustc_target/src/target_features.rs

+1
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
390390
("amx-tf32", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
391391
("amx-tile", Unstable(sym::x86_amx_intrinsics), &[]),
392392
("amx-transpose", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
393+
("apxf", Unstable(sym::apx_target_feature), &[]),
393394
("avx", Stable, &["sse4.2"]),
394395
("avx2", Stable, &["avx"]),
395396
("avx512bf16", Unstable(sym::avx512_target_feature), &["avx512bw"]),

0 commit comments

Comments
 (0)