diff options
Diffstat (limited to 'gcc/config/s390')
-rw-r--r-- | gcc/config/s390/s390.c | 31 | ||||
-rw-r--r-- | gcc/config/s390/s390.h | 23 |
2 files changed, 29 insertions, 25 deletions
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 53082ecca64..46d6c32bd9c 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -496,7 +496,7 @@ struct GTY(()) machine_function CONST_OK_FOR_CONSTRAINT_P((x), 'O', "On") #define REGNO_PAIR_OK(REGNO, MODE) \ - (HARD_REGNO_NREGS ((REGNO), (MODE)) == 1 || !((REGNO) & 1)) + (s390_hard_regno_nregs ((REGNO), (MODE)) == 1 || !((REGNO) & 1)) /* That's the read ahead of the dynamic branch prediction unit in bytes on a z10 (or higher) CPU. */ @@ -10383,7 +10383,32 @@ s390_optimize_nonescaping_tx (void) return; } -/* Implement TARGET_HARD_REGNO_MODE_OK. */ +/* Implement TARGET_HARD_REGNO_NREGS. Because all registers in a class + have the same size, this is equivalent to CLASS_MAX_NREGS. */ + +static unsigned int +s390_hard_regno_nregs (unsigned int regno, machine_mode mode) +{ + return s390_class_max_nregs (REGNO_REG_CLASS (regno), mode); +} + +/* Implement TARGET_HARD_REGNO_MODE_OK. + + Integer modes <= word size fit into any GPR. + Integer modes > word size fit into successive GPRs, starting with + an even-numbered register. + SImode and DImode fit into FPRs as well. + + Floating point modes <= word size fit into any FPR or GPR. + Floating point modes > word size (i.e. DFmode on 32-bit) fit + into any FPR, or an even-odd GPR pair. + TFmode fits only into an even-odd FPR pair. + + Complex floating point modes fit either into two FPRs, or into + successive GPRs (again starting with an even number). + TCmode fits only into two successive even-odd FPR pairs. + + Condition code modes fit only into the CC register. */ static bool s390_hard_regno_mode_ok (unsigned int regno, machine_mode mode) @@ -15977,6 +16002,8 @@ s390_asan_shadow_offset (void) #undef TARGET_HARD_REGNO_SCRATCH_OK #define TARGET_HARD_REGNO_SCRATCH_OK s390_hard_regno_scratch_ok +#undef TARGET_HARD_REGNO_NREGS +#define TARGET_HARD_REGNO_NREGS s390_hard_regno_nregs #undef TARGET_HARD_REGNO_MODE_OK #define TARGET_HARD_REGNO_MODE_OK s390_hard_regno_mode_ok #undef TARGET_MODES_TIEABLE_P diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h index a52f866628a..0682fb668bc 100644 --- a/gcc/config/s390/s390.h +++ b/gcc/config/s390/s390.h @@ -469,29 +469,6 @@ extern const char *s390_host_detect_local_cpu (int argc, const char **argv); 15, 32, 33, 34, 35, 36, 37 } -/* Fitting values into registers. */ - -/* Integer modes <= word size fit into any GPR. - Integer modes > word size fit into successive GPRs, starting with - an even-numbered register. - SImode and DImode fit into FPRs as well. - - Floating point modes <= word size fit into any FPR or GPR. - Floating point modes > word size (i.e. DFmode on 32-bit) fit - into any FPR, or an even-odd GPR pair. - TFmode fits only into an even-odd FPR pair. - - Complex floating point modes fit either into two FPRs, or into - successive GPRs (again starting with an even number). - TCmode fits only into two successive even-odd FPR pairs. - - Condition code modes fit only into the CC register. */ - -/* Because all registers in a class have the same size HARD_REGNO_NREGS - is equivalent to CLASS_MAX_NREGS. */ -#define HARD_REGNO_NREGS(REGNO, MODE) \ - s390_class_max_nregs (REGNO_REG_CLASS (REGNO), (MODE)) - #define HARD_REGNO_RENAME_OK(FROM, TO) \ s390_hard_regno_rename_ok ((FROM), (TO)) |