This is the mail archive of the gcc@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: extending fpmuls


On Mon, Oct 24, 2011 at 11:12:29PM -0400, David Miller wrote:
> 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)))

That is correct.  float a * float b is supposed to e.g. result in Inf
if the product overflows float (but would still fit into double).
I bet
double fsmuld (float a, float b)
{
  return (double) a * b;
}
instead will match your pattern, then the operands are first extended
into double and then multiplied into a double product.

	Jakub


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