diff options
Diffstat (limited to 'gcc/config/rs6000')
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 23 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.h | 7 |
2 files changed, 23 insertions, 7 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index a787a29f9f8..9c6beb1839a 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1962,6 +1962,9 @@ static const struct attribute_spec rs6000_attribute_table[] = #undef TARGET_OPTION_FUNCTION_VERSIONS #define TARGET_OPTION_FUNCTION_VERSIONS common_function_versions +#undef TARGET_HARD_REGNO_CALL_PART_CLOBBERED +#define TARGET_HARD_REGNO_CALL_PART_CLOBBERED \ + rs6000_hard_regno_call_part_clobbered /* Processor table. */ @@ -2124,6 +2127,26 @@ rs6000_hard_regno_mode_ok (int regno, machine_mode mode) return GET_MODE_SIZE (mode) <= UNITS_PER_WORD; } +/* Implement TARGET_HARD_REGNO_CALL_PART_CLOBBERED. */ + +static bool +rs6000_hard_regno_call_part_clobbered (unsigned int regno, machine_mode mode) +{ + if (TARGET_32BIT + && TARGET_POWERPC64 + && GET_MODE_SIZE (mode) > 4 + && INT_REGNO_P (regno)) + return true; + + if (TARGET_VSX + && FP_REGNO_P (regno) + && GET_MODE_SIZE (mode) > 8 + && !FLOAT128_2REG_P (mode)) + return true; + + return false; +} + /* Print interesting facts about registers. */ static void rs6000_debug_reg_print (int first_regno, int last_regno, const char *reg_name) diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index d668c9b8f50..9114b35e46f 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -1236,13 +1236,6 @@ enum data_align { align_abi, align_opt, align_both }; ? DImode \ : choose_hard_reg_mode ((REGNO), (NREGS), false)) -#define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) \ - (((TARGET_32BIT && TARGET_POWERPC64 \ - && (GET_MODE_SIZE (MODE) > 4) \ - && INT_REGNO_P (REGNO)) ? 1 : 0) \ - || (TARGET_VSX && FP_REGNO_P (REGNO) \ - && GET_MODE_SIZE (MODE) > 8 && !FLOAT128_2REG_P (MODE))) - #define VSX_VECTOR_MODE(MODE) \ ((MODE) == V4SFmode \ || (MODE) == V2DFmode) \ |