This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
extending fpmuls
- From: David Miller <davem at davemloft dot net>
- To: gcc at gcc dot gnu dot org
- Cc: rth at redhat dot com
- Date: Mon, 24 Oct 2011 23:12:29 -0400 (EDT)
- Subject: extending fpmuls
While working on some test cases I noticed that the 'fsmuld'
instruction on sparc was not being matched by the combiner for
things like:
double fsmuld (float a, float b)
{
return a * b;
}
Combine does try to match:
(set x (float_extend:DF (mul:SF y z)))
instead of what backends (and in particular at least Sparc and Alpha)
seem to use canonically for this pattern which is:
(set x (mul:DF (float_extend:DF y) (float_extend:DF y)))
Something similar happens for:
double fnsmuld (float a, float b)
{
return -(a * b);
}
which combine should match to the *fnsmuld sparc.md pattern,
but similar to above combine tries:
(set x (float_extend:DF (mul:SF (neg:SF y) z)))
instead of:
(set x (mul:DF (neg:DF (float_extend:DF y) (float_extend:DF z))))
Which is right? "Canonicalization of Instructions" in the internals
documentation doesn't give any guidance :-)