Skip to content

Commit

Permalink
Unrolled build for rust-lang#134042
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#134042 - sayantn:power8-crypto, r=jieyouxu

Add the `power8-crypto` target feature

Add the `power8-crypto` target feature. This will enable adding some new PPC intrinsics in stdarch (specifically AES, SHA and CLMUL intrinsics). The implied target feature is from [here](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/PowerPC/PPC.td)

```@rustbot``` label A-target-feature O-PowerPC
  • Loading branch information
rust-timer authored Dec 11, 2024
2 parents 33c245b + 1220f39 commit ff9c59f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
"aarch64"
} else if sess.target.arch == "sparc64" {
"sparc"
} else if sess.target.arch == "powerpc64" {
"powerpc"
} else {
&*sess.target.arch
};
Expand Down Expand Up @@ -289,6 +291,7 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
// https://github.com/llvm/llvm-project/blob/llvmorg-18.1.0/llvm/lib/Target/Sparc/MCTargetDesc/SparcELFObjectWriter.cpp#L26
("sparc", "v8plus") if get_version().0 == 19 => Some(LLVMFeature::new("v9")),
("sparc", "v8plus") if get_version().0 < 19 => None,
("powerpc", "power8-crypto") => Some(LLVMFeature::new("crypto")),
(_, s) => Some(LLVMFeature::new(s)),
}
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_target/src/target_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ const POWERPC_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
("partword-atomics", Unstable(sym::powerpc_target_feature), &[]),
("power10-vector", Unstable(sym::powerpc_target_feature), &["power9-vector"]),
("power8-altivec", Unstable(sym::powerpc_target_feature), &["altivec"]),
("power8-crypto", Unstable(sym::powerpc_target_feature), &["power8-altivec"]),
("power8-vector", Unstable(sym::powerpc_target_feature), &["vsx", "power8-altivec"]),
("power9-altivec", Unstable(sym::powerpc_target_feature), &["power8-altivec"]),
("power9-vector", Unstable(sym::powerpc_target_feature), &["power8-vector", "power9-altivec"]),
Expand Down
1 change: 1 addition & 0 deletions tests/ui/check-cfg/target_feature.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
`popcnt`
`power10-vector`
`power8-altivec`
`power8-crypto`
`power8-vector`
`power9-altivec`
`power9-vector`
Expand Down

0 comments on commit ff9c59f

Please sign in to comment.