http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51340

--- Comment #3 from Kazumoto Kojima <kkojima at gcc dot gnu.org> 2011-12-28 
22:31:27 UTC ---
(In reply to comment #2)
> Uhm, yes...
> The title should have been "Enable -mfused-madd by -ffast-math"

Do you mean something like this?

--- ORIG/trunk/gcc/config/sh/sh.c    2011-12-03 10:03:41.000000000 +0900
+++ trunk/gcc/config/sh/sh.c    2011-12-27 08:33:23.000000000 +0900
@@ -838,6 +838,11 @@ sh_option_override (void)
     align_functions = min_align;
     }

+  /* Default to use fmac insn when -ffast-math.  See PR target/29100.  */
+  if (global_options_set.x_TARGET_FMAC == 0
+      && fast_math_flags_set_p (&global_options)
+    TARGET_FMAC = 1;
+
   if (sh_fixed_range_str)
     sh_fix_range (sh_fixed_range_str);

> I don't know the exact semantics for the new patterns.  All I know is that
> rounding is supposed to be done only once after the two operations.  This is
> the case for the SH fmac insn.  Not sure whether this is enough though.

It seems that we can use the fma pattern, though it would be an another issue.

Reply via email to