Skip to content

Commit 103f9f6

Browse files
committed
Auto merge of #149632 - matthiaskrgr:rollup-c5iqgtn, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - rust-lang/rust#149521 (Improve `io::Error::downcast`) - rust-lang/rust#149544 (Only apply `no_mangle_const_items`'s suggestion to plain const items) - rust-lang/rust#149545 (fix the check for which expressions read never type) - rust-lang/rust#149570 (rename cortex-ar references to unified aarch32) - rust-lang/rust#149574 (Batched compiletest Config fixups) - rust-lang/rust#149579 (Motor OS: fix compile error) - rust-lang/rust#149595 (Tidying up `tests/ui/issues` tests [2/N]) - rust-lang/rust#149597 (Revert "implement and test `Iterator::{exactly_one, collect_array}`") - rust-lang/rust#149608 (Allow PowerPC spe_acc as clobber-only register) - rust-lang/rust#149610 (Implement benchmarks for uN::{gather,scatter}_bits) r? `@ghost` `@rustbot` modify labels: rollup
2 parents f10940a + 7fac29f commit 103f9f6

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

src/asm.rs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,16 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
209209
}
210210
("r", dummy_output_type(self.cx, reg.reg_class()))
211211
} else {
212-
// `clobber_abi` can add lots of clobbers that are not supported by the target,
213-
// such as AVX-512 registers, so we just ignore unsupported registers
214-
let is_target_supported =
215-
reg.reg_class().supported_types(asm_arch, true).iter().any(
212+
let is_target_supported = match reg.reg_class() {
213+
// `clobber_abi` clobbers spe_acc on all PowerPC targets. This
214+
// register is unique to the powerpc*spe target, and the target
215+
// is not supported by gcc. Ignore it.
216+
InlineAsmRegClass::PowerPC(
217+
PowerPCInlineAsmRegClass::spe_acc,
218+
) => false,
219+
// `clobber_abi` can add lots of clobbers that are not supported by the target,
220+
// such as AVX-512 registers, so we just ignore unsupported registers
221+
x => x.supported_types(asm_arch, true).iter().any(
216222
|&(_, feature)| {
217223
if let Some(feature) = feature {
218224
self.tcx
@@ -222,7 +228,8 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
222228
true // Register class is unconditionally supported
223229
}
224230
},
225-
);
231+
),
232+
};
226233

227234
if is_target_supported && !clobbers.contains(&reg_name) {
228235
clobbers.push(reg_name);
@@ -710,7 +717,8 @@ fn reg_class_to_gcc(reg_class: InlineAsmRegClass) -> &'static str {
710717
PowerPCInlineAsmRegClass::cr
711718
| PowerPCInlineAsmRegClass::ctr
712719
| PowerPCInlineAsmRegClass::lr
713-
| PowerPCInlineAsmRegClass::xer,
720+
| PowerPCInlineAsmRegClass::xer
721+
| PowerPCInlineAsmRegClass::spe_acc,
714722
) => {
715723
unreachable!("clobber-only")
716724
}
@@ -793,7 +801,8 @@ fn dummy_output_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, reg: InlineAsmRegCl
793801
PowerPCInlineAsmRegClass::cr
794802
| PowerPCInlineAsmRegClass::ctr
795803
| PowerPCInlineAsmRegClass::lr
796-
| PowerPCInlineAsmRegClass::xer,
804+
| PowerPCInlineAsmRegClass::xer
805+
| PowerPCInlineAsmRegClass::spe_acc,
797806
) => {
798807
unreachable!("clobber-only")
799808
}

0 commit comments

Comments
 (0)