From a746ceb6506b21705bd35473144c60194ae3191d Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 30 Nov 2023 21:27:30 +0300 Subject: [PATCH] AArch64: Make x18 register allocatable on Linux --- ir_aarch64.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ir_aarch64.h b/ir_aarch64.h index c699ee2..183d3ec 100644 --- a/ir_aarch64.h +++ b/ir_aarch64.h @@ -104,10 +104,16 @@ enum _ir_reg { IR_REG_X31 #define IR_REG_FRAME_POINTER \ IR_REG_X29 + +#if defined(__linux__) #define IR_REGSET_FIXED \ - ( IR_REGSET(IR_REG_INT_TMP) \ - | IR_REGSET(IR_REG_X18) /* platform specific register */ \ - | IR_REGSET_INTERVAL(IR_REG_X29, IR_REG_X31)) + (IR_REGSET(IR_REG_INT_TMP) | IR_REGSET_INTERVAL(IR_REG_X29, IR_REG_X31)) +#else +#define IR_REGSET_FIXED \ + (IR_REGSET(IR_REG_INT_TMP) | IR_REGSET_INTERVAL(IR_REG_X29, IR_REG_X31) \ + | IR_REGSET(IR_REG_X18)) /* Other platforms reserve x18 register */ +#endif + #define IR_REGSET_GP \ IR_REGSET_DIFFERENCE(IR_REGSET_INTERVAL(IR_REG_GP_FIRST, IR_REG_GP_LAST), IR_REGSET_FIXED) #define IR_REGSET_FP \