This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/53511] SH Target: Add support for fma patterns


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

Oleg Endo <olegendo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kkojima at gcc dot gnu.org

--- Comment #2 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-06-03 18:29:32 UTC ---
The proposed patch adds the fmasf4 pattern and seems to be working OK (not
fully tested yet).

However, there are some side effects.
Because the option '-ffp-contract=' is set to 'fast' by default, the middle-end
will automatically convert expressions such as 'a * b + c' to fma patterns,
even without setting '-funsafe-math-optimizations'.  To disable this one has to
set '-ffp-contract=on' (see also
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48823#c3 ).

I'm afraid that if the fmasf4 pattern is always enabled, there could be some
issues with expected default behavior (as mentioned in
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51340#c1 ).
On the other hand, if the fmasf4 pattern is not always enabled, the std C
'fmaf' function can't be expanded to the 'fmac' insn.

Also, according to the discussion in PR 37845, it seems that the default
setting should leave the fma patterns enabled.

Effectively, the '*macsf3' / 'mac_media' patterns and the -mfused-madd /
-mno-fused-madd replicate middle-end functionality which is given by the 'fma'
patterns and the '-ffp-contract=' option.
Thus I'd like to propose to remove the '*macsf3' / 'mac_media' patterns and
deprecate the -mfused-madd / -mno-fused-madd options.

Kaz, what do you think?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]