This is the mail archive of the gcc-patches@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]

Re: RFA: Add Epiphany port


Quoting Andrew Pinski <pinskia@gmail.com>:

On Thu, Nov 3, 2011 at 11:08 AM, Joern Rennecke <amylaar@spamcop.net> wrote:
+@smallexample
+float __builtin_epiphany_fmadd (float a, float b, float c) /* a + b * c */
+float __builtin_epiphany_fmsub (float a, float b, float c) /* a - b * c */
+@end smallexample

I don't think you need target specific builtins for these any more.

I could conceivably implement __builtin_epiphany_fmadd in a header file using fma, reordering the operands, but that would only make the port messier. The semantics of fma are not documented in extend.texi.

What's more, __builtin_epiphany_fmsub is a different operation than fmssf4 -
it subtracts the product from the scalar, while fmssf4 subtracts the scalar
from the product.  Besides, there is no builtin for fmssf4 anyway.
So I need the builtin for __builtin_epiphany_fmsub .  Keeping the
existing __builtin_epiphany_fmadd is then simpler than to convert that
one intrinsic from a builtin into a macro.

Also all your fma patterns are now incorrect. You should use fma for the RTL.

Why is that incorrect? They still describe the operation. And fms is the wrong operation, anyway. Changing only fmadd -> fma would break the symmetry between the add and sub pattern inside the port, so I don't see that there would be any net gain.

There is an fmasf4 expander, so the high-level optimizers can do their thing.


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