Commit d83aba0f by Richard Sandiford Committed by Richard Sandiford

optabs.c (expand_unop): Try implementing negation using subtraction from zero.

	* optabs.c (expand_unop): Try implementing negation using subtraction
	from zero.

From-SVN: r81933
parent 15581992
2004-05-17 Richard Sandiford <rsandifo@redhat.com>
* optabs.c (expand_unop): Try implementing negation using subtraction
from zero.
2004-05-16 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> 2004-05-16 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* pa.md: Fix typo from last change. Remove DFmode move to and from * pa.md: Fix typo from last change. Remove DFmode move to and from
......
...@@ -2737,6 +2737,15 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target, ...@@ -2737,6 +2737,15 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
return temp; return temp;
} }
/* If there is no negation pattern, try subtracting from zero. */
if (unoptab == neg_optab && class == MODE_INT)
{
temp = expand_binop (mode, sub_optab, CONST0_RTX (mode), op0,
target, unsignedp, OPTAB_DIRECT);
if (temp)
return temp;
}
try_libcall: try_libcall:
/* Now try a library call in this mode. */ /* Now try a library call in this mode. */
if (unoptab->handlers[(int) mode].libfunc) if (unoptab->handlers[(int) mode].libfunc)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment