Browse Source

aarch64: suggest a scratch register that's not caller-saved;

If the scratch register is caller-saved, then it might appear in fixed
ranges because of call clobbers. Instead, use a register that's not
caller-saved and has no predefined use in the ABI.
pull/1699/head
Benjamin Bouvier 5 years ago
parent
commit
07c55fa50f
  1. 2
      cranelift/codegen/src/isa/aarch64/inst/regs.rs

2
cranelift/codegen/src/isa/aarch64/inst/regs.rs

@ -206,7 +206,7 @@ pub fn create_reg_universe(flags: &settings::Flags) -> RealRegUniverse {
allocable_by_class[RegClass::I64.rc_to_usize()] = Some(RegClassInfo { allocable_by_class[RegClass::I64.rc_to_usize()] = Some(RegClassInfo {
first: x_reg_base as usize, first: x_reg_base as usize,
last: x_reg_last as usize, last: x_reg_last as usize,
suggested_scratch: Some(XREG_INDICES[13] as usize), suggested_scratch: Some(XREG_INDICES[19] as usize),
}); });
allocable_by_class[RegClass::V128.rc_to_usize()] = Some(RegClassInfo { allocable_by_class[RegClass::V128.rc_to_usize()] = Some(RegClassInfo {
first: v_reg_base as usize, first: v_reg_base as usize,

Loading…
Cancel
Save