diff options
| author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-17 06:50:51 +0000 |
|---|---|---|
| committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-17 06:50:51 +0000 |
| commit | 7c7a9a99dae100461a6abead0ca1a12eb4f97155 (patch) | |
| tree | 131eefbed273dab9a9fd55429e994aa6633bb521 | |
| parent | c658423ab8a3605a342640eff4f799a22a228f30 (diff) | |
| download | ppe42-gcc-7c7a9a99dae100461a6abead0ca1a12eb4f97155.tar.gz ppe42-gcc-7c7a9a99dae100461a6abead0ca1a12eb4f97155.zip | |
* optabs.c (expand_unop): Try implementing negation using subtraction
from zero.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81933 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/optabs.c | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cabd0f3fd77..80bbf2a57ad 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +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> * pa.md: Fix typo from last change. Remove DFmode move to and from diff --git a/gcc/optabs.c b/gcc/optabs.c index f89e053c456..562eb2902f9 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -2737,6 +2737,15 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target, 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: /* Now try a library call in this mode. */ if (unoptab->handlers[(int) mode].libfunc) |

