From 07c55fa50f214258817ec924a79404370a8321c8 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Tue, 12 May 2020 14:22:53 +0200 Subject: [PATCH] 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. --- cranelift/codegen/src/isa/aarch64/inst/regs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cranelift/codegen/src/isa/aarch64/inst/regs.rs b/cranelift/codegen/src/isa/aarch64/inst/regs.rs index 3a10231edf..099d816266 100644 --- a/cranelift/codegen/src/isa/aarch64/inst/regs.rs +++ b/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 { first: x_reg_base 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 { first: v_reg_base as usize,