Implement SystemV struct argument passing
This commit is contained in:
@@ -2152,6 +2152,8 @@ pub(crate) fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
|
||||
panic!("x86-specific opcode in supposedly arch-neutral IR!");
|
||||
}
|
||||
|
||||
Opcode::DummySarg => unreachable!(),
|
||||
|
||||
Opcode::AvgRound => unimplemented!(),
|
||||
Opcode::Iabs => unimplemented!(),
|
||||
Opcode::Snarrow
|
||||
|
||||
@@ -108,6 +108,19 @@ impl Args {
|
||||
|
||||
impl ArgAssigner for Args {
|
||||
fn assign(&mut self, arg: &AbiParam) -> ArgAction {
|
||||
if let ArgumentPurpose::StructArgument(size) = arg.purpose {
|
||||
if self.call_conv != CallConv::SystemV {
|
||||
panic!(
|
||||
"The sarg argument purpose is not yet implemented for non-systemv call conv {:?}",
|
||||
self.call_conv,
|
||||
);
|
||||
}
|
||||
let loc = ArgumentLoc::Stack(self.offset as i32);
|
||||
self.offset += size;
|
||||
debug_assert!(self.offset <= i32::MAX as u32);
|
||||
return ArgAction::AssignAndChangeType(loc, types::SARG__);
|
||||
}
|
||||
|
||||
let ty = arg.value_type;
|
||||
|
||||
if ty.bits() > u16::from(self.pointer_bits) {
|
||||
|
||||
Reference in New Issue
Block a user