diff options
Diffstat (limited to 'gcc/config/avr/avr.cc')
-rw-r--r-- | gcc/config/avr/avr.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc index 74924ab..61c325f 100644 --- a/gcc/config/avr/avr.cc +++ b/gcc/config/avr/avr.cc @@ -6930,6 +6930,20 @@ avr_canonicalize_comparison (int *icode, rtx *op0, rtx *op1, bool op0_fixed) } } +/* Implement TARGET_C_MODE_FOR_FLOATING_TYPE. Return SFmode or DFmode + for TI_{LONG_,}DOUBLE_TYPE which is for {long,} double type, go with + the default one for the others. */ + +static machine_mode +avr_c_mode_for_floating_type (enum tree_index ti) +{ + if (ti == TI_DOUBLE_TYPE) + return avr_double == 32 ? SFmode : DFmode; + if (ti == TI_LONG_DOUBLE_TYPE) + return avr_long_double == 32 ? SFmode : DFmode; + return default_mode_for_floating_type (ti); +} + /* Output compare instruction @@ -16411,6 +16425,9 @@ avr_float_lib_compare_returns_bool (machine_mode mode, enum rtx_code) #undef TARGET_HAVE_SPECULATION_SAFE_VALUE #define TARGET_HAVE_SPECULATION_SAFE_VALUE speculation_safe_value_not_needed +#undef TARGET_C_MODE_FOR_FLOATING_TYPE +#define TARGET_C_MODE_FOR_FLOATING_TYPE avr_c_mode_for_floating_type + struct gcc_target targetm = TARGET_INITIALIZER; |