Skip to content

Commit bda062e

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

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

+22
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,28 @@ 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", "egpr" | "push2pop2" | "ppx" | "ndd" | "ccmp" | "cf") if get_version().0 < 18 => {
301+
None
302+
}
303+
("x86", "nf" | "zu" | "inline-asm-use-gpr32") if get_version() < (19, 1, 0) => None,
304+
("x86", "apxf") => {
305+
if get_version() < (19, 1, 0) {
306+
None
307+
} else {
308+
Some(LLVMFeature::with_dependencies(
309+
"egpr",
310+
smallvec![
311+
TargetFeatureFoldStrength::Both("push2pop2"),
312+
TargetFeatureFoldStrength::Both("ppx"),
313+
TargetFeatureFoldStrength::Both("ndd"),
314+
TargetFeatureFoldStrength::Both("ccmp"),
315+
TargetFeatureFoldStrength::Both("cf"),
316+
TargetFeatureFoldStrength::Both("nf"),
317+
TargetFeatureFoldStrength::Both("zu"),
318+
],
319+
))
320+
}
321+
}
300322
(_, s) => Some(LLVMFeature::new(s)),
301323
}
302324
}

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)