diff options
Diffstat (limited to 'gcc/config/msp430/msp430.c')
-rw-r--r-- | gcc/config/msp430/msp430.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c index 3102939..cd39433 100644 --- a/gcc/config/msp430/msp430.c +++ b/gcc/config/msp430/msp430.c @@ -3097,20 +3097,22 @@ use_32bit_hwmult (void) /* Returns true if the current MCU does not have a hardware multiplier of any kind. */ -static bool -msp430_no_hwmult (void) +bool +msp430_has_hwmult (void) { static const char * cached_match = NULL; static bool cached_result; if (msp430_hwmult_type == MSP430_HWMULT_NONE) - return true; + return false; + /* TRUE for any other explicit hwmult specified. */ if (msp430_hwmult_type != MSP430_HWMULT_AUTO) - return false; + return true; + /* Now handle -mhwmult=auto. */ if (target_mcu == NULL) - return true; + return false; if (target_mcu == cached_match) return cached_result; @@ -3119,11 +3121,11 @@ msp430_no_hwmult (void) msp430_extract_mcu_data (target_mcu); if (extracted_mcu_data.name != NULL) - return cached_result = extracted_mcu_data.hwmpy == 0; + return cached_result = extracted_mcu_data.hwmpy != 0; /* If we do not recognise the MCU name, we assume that it does not support any kind of hardware multiply - this is the safest assumption to make. */ - return cached_result = true; + return cached_result = false; } /* This function does the same as the default, but it will replace GCC @@ -3143,13 +3145,13 @@ msp430_output_labelref (FILE *file, const char *name) /* If we have been given a specific MCU name then we may be able to make use of its hardware multiply capabilities. */ - if (msp430_hwmult_type != MSP430_HWMULT_NONE) + if (msp430_has_hwmult ()) { if (strcmp ("__mspabi_mpyi", name) == 0) { if (msp430_use_f5_series_hwmult ()) name = "__mulhi2_f5"; - else if (! msp430_no_hwmult ()) + else name = "__mulhi2"; } else if (strcmp ("__mspabi_mpyl", name) == 0) @@ -3158,7 +3160,7 @@ msp430_output_labelref (FILE *file, const char *name) name = "__mulsi2_f5"; else if (use_32bit_hwmult ()) name = "__mulsi2_hw32"; - else if (! msp430_no_hwmult ()) + else name = "__mulsi2"; } } |