diff options
author | Richard Henderson <rth@redhat.com> | 2003-06-03 14:29:48 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2003-06-03 14:29:48 -0700 |
commit | 2ef0a555115b893fcd775844882435e07552b4b9 (patch) | |
tree | 474d4af43e85adcdc142a5e4c94f30a48a445a94 | |
parent | b0c242c02902036570dc8c65f76361cc27f2f119 (diff) | |
download | gcc-2ef0a555115b893fcd775844882435e07552b4b9.zip gcc-2ef0a555115b893fcd775844882435e07552b4b9.tar.gz gcc-2ef0a555115b893fcd775844882435e07552b4b9.tar.bz2 |
optabs.c (expand_abs_nojump): Split out from ...
* optabs.c (expand_abs_nojump): Split out from ...
(expand_abs): ... here.
* optabs.h (expand_abs_nojump): Declare.
* ifcvt.c: (noce_try_abs): Use expand_abs_nojump.
* Makefile.in (ifcvt.o): Depend on optabs.h.
From-SVN: r67404
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/Makefile.in | 6 | ||||
-rw-r--r-- | gcc/ifcvt.c | 3 | ||||
-rw-r--r-- | gcc/optabs.c | 22 | ||||
-rw-r--r-- | gcc/optabs.h | 1 |
5 files changed, 33 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 89583f3..dfc37dd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2003-06-03 Richard Henderson <rth@redhat.com> + + * optabs.c (expand_abs_nojump): Split out from ... + (expand_abs): ... here. + * optabs.h (expand_abs_nojump): Declare. + * ifcvt.c: (noce_try_abs): Use expand_abs_nojump. + * Makefile.in (ifcvt.o): Depend on optabs.h. + 2003-06-03 Alan Modra <amodra@bigpond.net.au> * dwarf2out.c (DEBUG_STR_SECTION_FLAGS): Heed flag_merge_constants. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 4117661..b2f99b4 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1776,9 +1776,9 @@ timevar.o : timevar.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TIMEVAR_H) f regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h $(RECOG_H) function.h \ resource.h $(OBSTACK_H) flags.h $(TM_P_H) -ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) toplev.h \ - flags.h insn-config.h function.h $(RECOG_H) $(BASIC_BLOCK_H) $(EXPR_H) \ - output.h except.h $(TM_P_H) real.h +ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(REGS_H) toplev.h flags.h insn-config.h function.h $(RECOG_H) \ + $(BASIC_BLOCK_H) $(EXPR_H) output.h except.h $(TM_P_H) real.h optabs.h params.o : params.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(PARAMS_H) toplev.h hooks.o: hooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(HOOKS_H) diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index ec7286b..caa54c5 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -35,6 +35,7 @@ #include "expr.h" #include "real.h" #include "output.h" +#include "optabs.h" #include "toplev.h" #include "tm_p.h" @@ -1602,7 +1603,7 @@ noce_try_abs (if_info) start_sequence (); - target = expand_simple_unop (GET_MODE (if_info->x), ABS, b, if_info->x, 0); + target = expand_abs_nojump (GET_MODE (if_info->x), b, if_info->x, 1); /* ??? It's a quandry whether cmove would be better here, especially for integers. Perhaps combine will clean things up. */ diff --git a/gcc/optabs.c b/gcc/optabs.c index f57c814..b59f89c 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -2773,14 +2773,13 @@ expand_unop (mode, unoptab, op0, target, unsignedp) */ rtx -expand_abs (mode, op0, target, result_unsignedp, safe) +expand_abs_nojump (mode, op0, target, result_unsignedp) enum machine_mode mode; rtx op0; rtx target; int result_unsignedp; - int safe; { - rtx temp, op1; + rtx temp; if (! flag_trapv) result_unsignedp = 1; @@ -2868,6 +2867,23 @@ expand_abs (mode, op0, target, result_unsignedp, safe) return temp; } + return NULL_RTX; +} + +rtx +expand_abs (mode, op0, target, result_unsignedp, safe) + enum machine_mode mode; + rtx op0; + rtx target; + int result_unsignedp; + int safe; +{ + rtx temp, op1; + + temp = expand_abs_nojump (mode, op0, target, result_unsignedp); + if (temp != 0) + return temp; + /* If that does not win, use conditional jump and negate. */ /* It is safe to use the target if it is the same diff --git a/gcc/optabs.h b/gcc/optabs.h index e9f95fa..22e2422 100644 --- a/gcc/optabs.h +++ b/gcc/optabs.h @@ -306,6 +306,7 @@ extern int expand_twoval_binop PARAMS ((optab, rtx, rtx, rtx, rtx, int)); extern rtx expand_unop PARAMS ((enum machine_mode, optab, rtx, rtx, int)); /* Expand the absolute value operation. */ +extern rtx expand_abs_nojump PARAMS ((enum machine_mode, rtx, rtx, int)); extern rtx expand_abs PARAMS ((enum machine_mode, rtx, rtx, int, int)); /* Expand the complex absolute value operation. */ |