Skip to content

Commit 9684ae4

Browse files
committed
Dispatch inline asm to the correct arch
1 parent 0fe17ba commit 9684ae4

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/inline_asm.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub(crate) fn codegen_inline_asm<'tcx>(
108108

109109
let mut asm_gen = InlineAssemblyGenerator {
110110
tcx: fx.tcx,
111-
arch: InlineAsmArch::X86_64,
111+
arch: fx.tcx.sess.asm_arch.unwrap(),
112112
template,
113113
operands,
114114
options,
@@ -306,12 +306,8 @@ impl<'tcx> InlineAssemblyGenerator<'_, 'tcx> {
306306
let mut slots_output = vec![None; self.operands.len()];
307307

308308
let new_slot_fn = |slot_size: &mut Size, reg_class: InlineAsmRegClass| {
309-
let reg_size = reg_class
310-
.supported_types(InlineAsmArch::X86_64)
311-
.iter()
312-
.map(|(ty, _)| ty.size())
313-
.max()
314-
.unwrap();
309+
let reg_size =
310+
reg_class.supported_types(self.arch).iter().map(|(ty, _)| ty.size()).max().unwrap();
315311
let align = rustc_target::abi::Align::from_bytes(reg_size.bytes()).unwrap();
316312
let offset = slot_size.align_to(align);
317313
*slot_size = offset + reg_size;

0 commit comments

Comments
 (0)