Merge pull request #2363 from cfallin/extend-only-if-abi
Do value-extensions at ABI boundaries only when ABI requires it.
This commit is contained in:
@@ -728,6 +728,19 @@ impl ABIMachineSpec for AArch64MachineDeps {
|
||||
}
|
||||
caller_saved
|
||||
}
|
||||
|
||||
fn get_ext_mode(
|
||||
call_conv: isa::CallConv,
|
||||
specified: ir::ArgumentExtension,
|
||||
) -> ir::ArgumentExtension {
|
||||
if call_conv.extends_baldrdash() {
|
||||
// Baldrdash (SpiderMonkey) always extends args and return values to the full register.
|
||||
specified
|
||||
} else {
|
||||
// No other supported ABI on AArch64 does so.
|
||||
ir::ArgumentExtension::None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Is this type supposed to be seen on this machine? E.g. references of the
|
||||
|
||||
@@ -445,6 +445,13 @@ impl ABIMachineSpec for Arm32MachineDeps {
|
||||
}
|
||||
caller_saved
|
||||
}
|
||||
|
||||
fn get_ext_mode(
|
||||
_call_conv: isa::CallConv,
|
||||
specified: ir::ArgumentExtension,
|
||||
) -> ir::ArgumentExtension {
|
||||
specified
|
||||
}
|
||||
}
|
||||
|
||||
fn is_callee_save(r: RealReg) -> bool {
|
||||
|
||||
@@ -591,6 +591,19 @@ impl ABIMachineSpec for X64ABIMachineSpec {
|
||||
|
||||
caller_saved
|
||||
}
|
||||
|
||||
fn get_ext_mode(
|
||||
call_conv: isa::CallConv,
|
||||
specified: ir::ArgumentExtension,
|
||||
) -> ir::ArgumentExtension {
|
||||
if call_conv.extends_baldrdash() {
|
||||
// Baldrdash (SpiderMonkey) always extends args and return values to the full register.
|
||||
specified
|
||||
} else {
|
||||
// No other supported ABI on x64 does so.
|
||||
ir::ArgumentExtension::None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<StackAMode> for SyntheticAmode {
|
||||
|
||||
@@ -144,8 +144,13 @@ impl ArgAssigner for Args {
|
||||
return ValueConversion::VectorSplit.into();
|
||||
}
|
||||
|
||||
// Small integers are extended to the size of a pointer register.
|
||||
if ty.is_int() && ty.bits() < u16::from(self.pointer_bits) {
|
||||
// Small integers are extended to the size of a pointer register, but
|
||||
// only in ABIs that require this. The Baldrdash (SpiderMonkey) ABI
|
||||
// does, but our other supported ABIs on x86 do not.
|
||||
if ty.is_int()
|
||||
&& ty.bits() < u16::from(self.pointer_bits)
|
||||
&& self.call_conv.extends_baldrdash()
|
||||
{
|
||||
match arg.extension {
|
||||
ArgumentExtension::None => {}
|
||||
ArgumentExtension::Uext => return ValueConversion::Uext(self.pointer_type).into(),
|
||||
|
||||
Reference in New Issue
Block a user