OSDN Git Service

* rtlanal.c (set_noop_p): Return true for noop jumps.
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 20 Jul 2001 20:07:58 +0000 (20:07 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 20 Jul 2001 20:07:58 +0000 (20:07 +0000)
* expr.c (emit_single_push_insn): Add call to push expander.
* expr.h (optab_index): Add OTI_push
(push_optab): New constant.
* genopinit.c (optabs): Add push_optab.
* optabs.c (init_optab): Init push optab.
* md.texi (push??1): Document

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44210 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/expr.c
gcc/expr.h
gcc/genopinit.c
gcc/optabs.c
gcc/rtlanal.c

index b73cd66..8e1ab06 100644 (file)
@@ -1,3 +1,14 @@
+Fri Jul 20 21:59:42 CEST 2001  Jan Hubicka  <jh@suse.cz>
+
+       * rtlanal.c (set_noop_p): Return true for noop jumps.
+
+       * expr.c (emit_single_push_insn): Add call to push expander.
+       * expr.h (optab_index): Add OTI_push
+       (push_optab): New constant.
+       * genopinit.c (optabs): Add push_optab.
+       * optabs.c (init_optab): Init push optab.
+       * md.texi (push??1): Document
+
 2001-07-20  Stephane Carrez  <Stephane.Carrez@worldnet.fr>
 
        * config/m68hc11/m68hc11.md ("movdi", "movdi_internal"): Use an
index 041ee90..bd60d3f 100644 (file)
@@ -3155,7 +3155,21 @@ emit_single_push_insn (mode, x, type)
   rtx dest_addr;
   unsigned rounded_size = PUSH_ROUNDING (GET_MODE_SIZE (mode));
   rtx dest;
+  enum insn_code icode;
+  insn_operand_predicate_fn pred;
 
+  stack_pointer_delta += PUSH_ROUNDING (GET_MODE_SIZE (mode));
+  /* If there is push pattern, use it.  Otherwise try old way of throwing
+     MEM representing push operation to move expander.  */
+  icode = push_optab->handlers[(int) mode].insn_code;
+  if (icode != CODE_FOR_nothing)
+    {
+      if (((pred = insn_data[(int) icode].operand[0].predicate)
+         && !((*pred) (x, mode))))
+       x = force_reg (mode, x);
+      emit_insn (GEN_FCN (icode) (x));
+      return;
+    }
   if (GET_MODE_SIZE (mode) == rounded_size)
     dest_addr = gen_rtx_fmt_e (STACK_PUSH_CODE, Pmode, stack_pointer_rtx);
   else
@@ -3172,8 +3186,6 @@ emit_single_push_insn (mode, x, type)
 
   dest = gen_rtx_MEM (mode, dest_addr);
 
-  stack_pointer_delta += PUSH_ROUNDING (GET_MODE_SIZE (mode));
-
   if (type != 0)
     {
       set_mem_attributes (dest, type, 1);
index ed79d99..07b1a81 100644 (file)
@@ -378,6 +378,9 @@ enum optab_index
   OTI_cmov,
   OTI_cstore,
     
+  /* Push instruction.  */
+  OTI_push,
+
   OTI_MAX
 };
 
@@ -437,6 +440,7 @@ extern optab optab_table[OTI_MAX];
 #define cbranch_optab (optab_table[OTI_cbranch])
 #define cmov_optab (optab_table[OTI_cmov])
 #define cstore_optab (optab_table[OTI_cstore])
+#define push_optab (optab_table[OTI_push])
 
 /* Tables of patterns for extending one integer mode to another.  */
 extern enum insn_code extendtab[MAX_MACHINE_MODE][MAX_MACHINE_MODE][2];
index e8b1211..8e00718 100644 (file)
@@ -128,6 +128,7 @@ const char * const optabs[] =
   "cbranch_optab->handlers[$A].insn_code = CODE_FOR_$(cbranch$a4$)",
   "cmov_optab->handlers[$A].insn_code = CODE_FOR_$(cmov$a6$)",
   "cstore_optab->handlers[$A].insn_code = CODE_FOR_$(cstore$a4$)",
+  "push_optab->handlers[$A].insn_code = CODE_FOR_$(push$a1$)",
   "reload_in_optab[$A] = CODE_FOR_$(reload_in$a$)",
   "reload_out_optab[$A] = CODE_FOR_$(reload_out$a$)",
   "movstr_optab[$A] = CODE_FOR_$(movstr$a$)",
index f135ad1..84cf56d 100644 (file)
@@ -4682,6 +4682,7 @@ init_optabs ()
   cbranch_optab = init_optab (UNKNOWN);
   cmov_optab = init_optab (UNKNOWN);
   cstore_optab = init_optab (UNKNOWN);
+  push_optab = init_optab (UNKNOWN);
 
   for (i = 0; i < NUM_MACHINE_MODES; i++)
     {
index 90562ef..2f9696c 100644 (file)
@@ -998,6 +998,9 @@ set_noop_p (set)
   if (GET_CODE (dst) == MEM && GET_CODE (src) == MEM)
     return rtx_equal_p (dst, src);
 
+  if (dst == pc_rtx && src == pc_rtx)
+    return 1;
+
   if (GET_CODE (dst) == SIGN_EXTRACT
       || GET_CODE (dst) == ZERO_EXTRACT)
     return rtx_equal_p (XEXP (dst, 0), src)