Skip to content

Commit ffc40cb

Browse files
authored
Rollup merge of rust-lang#94339 - Amanieu:arm-d32, r=nagisa
ARM: Only allow using d16-d31 with asm! when supported by the target Support can be determined by checking for the "d32" LLVM feature. r? `@nagisa`
2 parents cf76a19 + 7cee1b4 commit ffc40cb

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

compiler/rustc_codegen_ssa/src/target_features.rs

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const ARM_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
3636
// #[target_feature].
3737
("thumb-mode", Some(sym::arm_target_feature)),
3838
("thumb2", Some(sym::arm_target_feature)),
39+
("d32", Some(sym::arm_target_feature)),
3940
];
4041

4142
const AARCH64_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[

compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ symbols! {
539539
custom_inner_attributes,
540540
custom_test_frameworks,
541541
d,
542+
d32,
542543
dbg_macro,
543544
dead_code,
544545
dealloc,

compiler/rustc_target/src/asm/arm.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,12 @@ impl ArmInlineAsmRegClass {
5050
match self {
5151
Self::reg => types! { _: I8, I16, I32, F32; },
5252
Self::sreg | Self::sreg_low16 => types! { vfp2: I32, F32; },
53-
Self::dreg | Self::dreg_low16 | Self::dreg_low8 => types! {
53+
Self::dreg_low16 | Self::dreg_low8 => types! {
5454
vfp2: I64, F64, VecI8(8), VecI16(4), VecI32(2), VecI64(1), VecF32(2);
5555
},
56+
Self::dreg => types! {
57+
d32: I64, F64, VecI8(8), VecI16(4), VecI32(2), VecI64(1), VecF32(2);
58+
},
5659
Self::qreg | Self::qreg_low8 | Self::qreg_low4 => types! {
5760
neon: VecI8(16), VecI16(8), VecI32(4), VecI64(2), VecF32(4);
5861
},

0 commit comments

Comments
 (0)