From 2ef0a555115b893fcd775844882435e07552b4b9 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Tue, 3 Jun 2003 14:29:48 -0700 Subject: [PATCH] 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 --- gcc/ChangeLog | 8 ++++++++ gcc/Makefile.in | 6 +++--- gcc/ifcvt.c | 3 ++- gcc/optabs.c | 22 +++++++++++++++++++--- gcc/optabs.h | 1 + 5 files changed, 33 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 89583f30a69..dfc37dd3d3f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2003-06-03 Richard Henderson + + * 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 * dwarf2out.c (DEBUG_STR_SECTION_FLAGS): Heed flag_merge_constants. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 41176616db8..b2f99b4d79e 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 ec7286bcaec..caa54c56b13 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 f57c81448dd..b59f89ca8c0 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 e9f95fa9091..22e2422ccd1 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. */ -- 2.30.2