]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
AVR: Implement TARGET_FLOATN_MODE.
authorGeorg-Johann Lay <avr@gjlay.de>
Fri, 4 Oct 2024 13:38:59 +0000 (15:38 +0200)
committerGeorg-Johann Lay <avr@gjlay.de>
Fri, 4 Oct 2024 14:36:30 +0000 (16:36 +0200)
gcc/
* config/avr/avr.cc (avr_floatn_mode): New static function.
(TARGET_FLOATN_MODE): New define.

gcc/config/avr/avr.cc

index 92013c3845db3a22d38e9cb269bfd3a9080b8fae..b73c251b64b49a44b1604ef1fb6e984e97222011 100644 (file)
@@ -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;
 
 \f