AArch64: Make x18 register allocatable on Linux

This commit is contained in:
Dmitry Stogov 2023-11-30 21:27:30 +03:00
parent dd77b6b71a
commit a746ceb650

View File

@ -104,10 +104,16 @@ enum _ir_reg {
IR_REG_X31 IR_REG_X31
#define IR_REG_FRAME_POINTER \ #define IR_REG_FRAME_POINTER \
IR_REG_X29 IR_REG_X29
#if defined(__linux__)
#define IR_REGSET_FIXED \ #define IR_REGSET_FIXED \
( IR_REGSET(IR_REG_INT_TMP) \ (IR_REGSET(IR_REG_INT_TMP) | IR_REGSET_INTERVAL(IR_REG_X29, IR_REG_X31))
| IR_REGSET(IR_REG_X18) /* platform specific register */ \ #else
| IR_REGSET_INTERVAL(IR_REG_X29, IR_REG_X31)) #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 \ #define IR_REGSET_GP \
IR_REGSET_DIFFERENCE(IR_REGSET_INTERVAL(IR_REG_GP_FIRST, IR_REG_GP_LAST), IR_REGSET_FIXED) IR_REGSET_DIFFERENCE(IR_REGSET_INTERVAL(IR_REG_GP_FIRST, IR_REG_GP_LAST), IR_REGSET_FIXED)
#define IR_REGSET_FP \ #define IR_REGSET_FP \