Skip to content

Commit 3ea91ac

Browse files
committed
rustc_target: Add the 32s target feature for LoongArch
1 parent 2886b36 commit 3ea91ac

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
277277
{
278278
None
279279
}
280+
("loongarch32" | "loongarch64", "32s") if get_version().0 < 21 => None,
280281
// Filter out features that are not supported by the current LLVM version
281282
("riscv32" | "riscv64", "zacas") if get_version().0 < 20 => None,
282283
(

compiler/rustc_target/src/target_features.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ static CSKY_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
763763

764764
static LOONGARCH_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
765765
// tidy-alphabetical-start
766+
("32s", Unstable(sym::loongarch_target_feature), &[]),
766767
("d", Stable, &["f"]),
767768
("div32", Unstable(sym::loongarch_target_feature), &[]),
768769
("f", Stable, &[]),

tests/ui/check-cfg/target_feature.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
66
|
77
= note: expected values for `target_feature` are: `10e60`
88
`2e3`
9+
`32s`
910
`3e3r1`
1011
`3e3r2`
1112
`3e3r3`

0 commit comments

Comments
 (0)