]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
optabs.c (expand_abs_nojump): Split out from ...
authorRichard Henderson <rth@redhat.com>
Tue, 3 Jun 2003 21:29:48 +0000 (14:29 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 3 Jun 2003 21:29:48 +0000 (14:29 -0700)
        * 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
gcc/Makefile.in
gcc/ifcvt.c
gcc/optabs.c
gcc/optabs.h

index 89583f30a6921049c5dfc1f76553907d91cef760..dfc37dd3d3fcb22026ac091beeca39f3b49ebb17 100644 (file)
@@ -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.
index 41176616db803b4a147e8dedd43ef1eed61dc4a0..b2f99b4d79e3740f6a0d28135fcff7d21a2b27ce 100644 (file)
@@ -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)
 
index ec7286bcaecc90b0eaa8e0c5cd7d199a5fe430fd..caa54c56b1379d400ea2a2729bd4eda70e9c99f0 100644 (file)
@@ -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.  */
index f57c81448dd3500d9a3d2eb2c2b738beeb794c95..b59f89ca8c0d0a2c0730df46331ad96fa619eabb 100644 (file)
@@ -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
index e9f95fa90914fe7c2840d00173fc06d20e537213..22e2422ccd1e906996ecf132fa6b7033b1320985 100644 (file)
@@ -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.  */