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: Fix tree-optimization/55524


Quoting Richard Biener <richard.guenther@gmail.com>:

On Mon, Apr 8, 2013 at 5:10 PM, Joern Rennecke
<joern.rennecke@embecosm.com> wrote:
This is basically the same patch as attached to the PR, except that I
have changed the goto-loop into a do-while loop with a new comment;
this caused the need for a lot of reformatting.

Can you please include a testcase that shows the effect of this?

Attached.
FWIW, the assembler is simpler to understand if you add the compilation
option -mfp-mode=round-nearest.
Without the patch, you then get:

_f:
        fmul r1,r1,r3
        mov r3, %low(#-2147483648)
        movt r3, %high(#-2147483648)
        eor r1,r3,r1
        fmadd r1,r0,r2
        mov r0,r1
        rts

And with the patch:

_f:
        fmul r0,r0,r2
        fmsub r0,r1,r3
        rts


2013-04-08  Joern Rennecke  <joern.rennecke@embecosm.com>

        * tree-ssa-math-opts.c (mult_to_fma_pass): New file static struct.
        (convert_mult_to_fma): In first pass, don't use an fms construct
        when we don't have an fms operation, but fmna.

it's fnma I believe.

Oops, yes, typo.  The patch itself has the right spelling.
2013-03-09  Joern Rennecke <joern.rennecke@embecosm.com>

	* gcc.target/epiphany/fnma-1.c: New test.

Index: gcc.target/epiphany/fnma-1.c
===================================================================
--- gcc.target/epiphany/fnma-1.c	(revision 0)
+++ gcc.target/epiphany/fnma-1.c	(working copy)
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-times "fmsub\[ \ta-zA-Z0-9\]*," 1 } } */
+
+float
+f (float ar, float ai, float br, float bi)
+{
+  return ar * br - ai * bi;
+}

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