This is the mail archive of the
mailing list for the GCC project.
Re: unfused fma question
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>, Jeff Law <law at redhat dot com>, Joseph Myers <joseph at codesourcery dot com>, Steve Ellcey <sellcey at imgtec dot com>
- Date: Tue, 24 Feb 2015 15:11:39 +0100
- Subject: Re: unfused fma question
- Authentication-results: sourceware.org; auth=none
- References: <02d0fee7-2c86-4291-8405-ae250d3210d9 at BAMAIL02 dot ba dot imgtec dot org> <alpine dot DEB dot 2 dot 10 dot 1502231833070 dot 7064 at digraph dot polyomino dot org dot uk> <54EB73FD dot 1000003 at redhat dot com> <alpine dot DEB dot 2 dot 11 dot 1502231946100 dot 1758 at laptop-mg dot saclay dot inria dot fr> <CAFiYyc02RYcLTH4dbz2PtKaHXSs+TuBbAxek6aMvAXA25xyd4w at mail dot gmail dot com> <54EC8307 dot 50206 at redhat dot com>
On Tue, Feb 24, 2015 at 2:56 PM, Andrew Haley <email@example.com> wrote:
> On 02/24/2015 12:14 PM, Richard Biener wrote:
>> These concerns are correct. Btw, as an answer to Steve - within
>> -funsafe-math-optimizations FMA_EXPR basically can be either
>> fused or not fused (but yes, bad as to Josephs concern).
>> So you could guard the pattern by flag_unsafe_math_optimizations.
> The unfused fma is always safe to use: it's the same as a multiply
> and an add, surely.
But it's not safe to use in place of a call to fma () - see fold_builtin_fma
which folds to FMA_EXPR if an optab is available (expecting that optab
to be a fused-multiply-add).