optabs.c (expand_binop): Optimize complex multiplication for the case of squaring a complex argument.

* optabs.c (expand_binop): Optimize complex multiplication for
	the case of squaring a complex argument.

From-SVN: r67418
This commit is contained in:
Roger Sayle 2003-06-04 04:42:14 +00:00 committed by Roger Sayle
parent 894207cf0a
commit df8ca70ebb
2 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2003-06-03 Roger Sayle <roger@eyesopen.com>
* optabs.c (expand_binop): Optimize complex multiplication for
the case of squaring a complex argument.
2003-06-03 Roger Sayle <roger@eyesopen.com>
* optabs.c (expand_binop): Attempt to reuse pseudos for duplicate

View File

@ -1647,6 +1647,11 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
temp1 = expand_binop (submode, binoptab, real0, imag1,
NULL_RTX, unsignedp, methods);
/* Avoid expanding redundant multiplication for the common
case of squaring a complex number. */
if (rtx_equal_p (real0, real1) && rtx_equal_p (imag0, imag1))
temp2 = temp1;
else
temp2 = expand_binop (submode, binoptab, real1, imag0,
NULL_RTX, unsignedp, methods);