diff options
author | Georg-Johann Lay <avr@gjlay.de> | 2024-10-04 15:38:59 +0200 |
---|---|---|
committer | Georg-Johann Lay <avr@gjlay.de> | 2024-10-04 16:36:30 +0200 |
commit | 98a1a886e4c0c58ad9f9846caf5697ff00e4f24a (patch) | |
tree | 2a638919afd6b4c700116a5726ce09ce20ec102a /gcc | |
parent | e2a701cd0419a1898a2a359711572a8bcf4f8eb3 (diff) | |
download | gcc-98a1a886e4c0c58ad9f9846caf5697ff00e4f24a.zip gcc-98a1a886e4c0c58ad9f9846caf5697ff00e4f24a.tar.gz gcc-98a1a886e4c0c58ad9f9846caf5697ff00e4f24a.tar.bz2 |
AVR: Implement TARGET_FLOATN_MODE.
gcc/
* config/avr/avr.cc (avr_floatn_mode): New static function.
(TARGET_FLOATN_MODE): New define.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/avr/avr.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc index 92013c3..b73c251 100644 --- a/gcc/config/avr/avr.cc +++ b/gcc/config/avr/avr.cc @@ -15473,6 +15473,24 @@ avr_c_mode_for_floating_type (tree_index ti) } +/* Implement `TARGET_FLOATN_MODE'. */ + +static opt_scalar_float_mode +avr_floatn_mode (int n, bool /*extended*/) +{ + if (n == 32) + return SFmode; + + // Notice that -m[long-]double= just tells which library (AVR-LibC + // or libgcc/libf7) is providing symbols like sin. DFmode support + // is provided by libf7 no matter what. + if (n == 64) + return DFmode; + + return opt_scalar_float_mode (); +} + + /* Worker function for `FLOAT_LIB_COMPARE_RETURNS_BOOL'. */ bool @@ -15705,6 +15723,9 @@ avr_use_lra_p () #undef TARGET_C_MODE_FOR_FLOATING_TYPE #define TARGET_C_MODE_FOR_FLOATING_TYPE avr_c_mode_for_floating_type +#undef TARGET_FLOATN_MODE +#define TARGET_FLOATN_MODE avr_floatn_mode + gcc_target targetm = TARGET_INITIALIZER; |