i386.c (ix86_expand_movstr, [...]): Consistently do libcall for large blocks.
authorJan Hubicka <jh@suse.cz>
Sat, 25 Jan 2003 15:00:51 +0000 (16:00 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 25 Jan 2003 15:00:51 +0000 (15:00 +0000)
* i386.c (ix86_expand_movstr, ix86_expand_clrstr): Consistently
do libcall for large blocks.
* i386.md (comi patterns): Set type to ssecomi.
(sse2_unpck?pd): Fix mode of vec_select.

* cse.c: Include except.h
(cse_set_around_loop):  Do not create new basic blocks.
* Makefile.in (cse.o): Add dependnecy on except.h

From-SVN: r61772

gcc/ChangeLog
gcc/Makefile.in
gcc/config/i386/i386.c
gcc/config/i386/i386.md
gcc/cse.c

index 118b147fc760c33aec6ed789745a6ad132856ac0..515a57d8eacfe6d06d60cf046b30072c09a2ba91 100644 (file)
@@ -1,3 +1,14 @@
+Sat Jan 25 15:55:08 CET 2003  Jan Hubicka  <jh@suse.cz>
+
+       * i386.c (ix86_expand_movstr, ix86_expand_clrstr): Consistently
+       do libcall for large blocks.
+       * i386.md (comi patterns): Set type to ssecomi.
+       (sse2_unpck?pd): Fix mode of vec_select.
+
+       * cse.c: Include except.h
+       (cse_set_around_loop):  Do not create new basic blocks.
+       * Makefile.in (cse.o): Add dependnecy on except.h
+
 Sat Jan 25 12:05:17 CET 2003  Jan Hubicka  <jh@suse.cz>
 
        * builtins.c (fold_trunc_transparent_mathfn): New function.
index f89929c50f2ae4721f9489dfe4517b041485029b..ecb1b33b5b83c1c747bc4e68d3b27beb714713ec 100644 (file)
@@ -1530,7 +1530,7 @@ cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_
    output.h function.h cselib.h $(GGC_H) $(TM_P_H) gt-cselib.h
 cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
    hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h output.h \
-   function.h $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_H)
+   function.h $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_H) except.h
 gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
    hard-reg-set.h flags.h real.h insn-config.h ggc.h $(RECOG_H) $(EXPR_H) \
    $(BASIC_BLOCK_H) function.h output.h toplev.h $(TM_P_H) $(PARAMS_H) except.h gt-gcse.h
index eaaf4abef8cf3e6c561bc936571e60eb2455ee19..fe76c91562b9d97bf4ebefbfab8602edbce1cc16 100644 (file)
@@ -10639,7 +10639,6 @@ ix86_expand_movstr (dst, src, count_exp, align_exp)
   unsigned HOST_WIDE_INT count = 0;
   rtx insns;
 
-  start_sequence ();
 
   if (GET_CODE (align_exp) == CONST_INT)
     align = INTVAL (align_exp);
@@ -10649,7 +10648,11 @@ ix86_expand_movstr (dst, src, count_exp, align_exp)
     align = 64;
 
   if (GET_CODE (count_exp) == CONST_INT)
-    count = INTVAL (count_exp);
+    {
+      count = INTVAL (count_exp);
+      if (!TARGET_INLINE_ALL_STRINGOPS && count > 64)
+       return 0;
+    }
 
   /* Figure out proper mode for counter.  For 32bits it is always SImode,
      for 64bits use SImode when possible, otherwise DImode.
@@ -10660,6 +10663,8 @@ ix86_expand_movstr (dst, src, count_exp, align_exp)
   else
     counter_mode = DImode;
 
+  start_sequence ();
+
   if (counter_mode != SImode && counter_mode != DImode)
     abort ();
 
@@ -10877,7 +10882,11 @@ ix86_expand_clrstr (src, count_exp, align_exp)
     align = 32;
 
   if (GET_CODE (count_exp) == CONST_INT)
-    count = INTVAL (count_exp);
+    {
+      count = INTVAL (count_exp);
+      if (!TARGET_INLINE_ALL_STRINGOPS && count > 64)
+       return 0;
+    }
   /* Figure out proper mode for counter.  For 32bits it is always SImode,
      for 64bits use SImode when possible, otherwise DImode.
      Set count to number of bytes copied when known at compile time.  */
index 688cf6b75fe21f69e396d5a4788eb06db3551f94..02874dc60fc38ee829ef7a8cc5c64da5a801d652 100644 (file)
    && SSE_FLOAT_MODE_P (GET_MODE (operands[0]))
    && GET_MODE (operands[0]) == GET_MODE (operands[0])"
   "* return output_fp_compare (insn, operands, 1, 0);"
-  [(set_attr "type" "fcmp,ssecmp")
+  [(set_attr "type" "fcmp,ssecomi")
    (set (attr "mode")
      (if_then_else (match_operand:SF 1 "" "")
         (const_string "SF")
   "SSE_FLOAT_MODE_P (GET_MODE (operands[0]))
    && GET_MODE (operands[0]) == GET_MODE (operands[0])"
   "* return output_fp_compare (insn, operands, 1, 0);"
-  [(set_attr "type" "ssecmp")
+  [(set_attr "type" "ssecomi")
    (set (attr "mode")
      (if_then_else (match_operand:SF 1 "" "")
         (const_string "SF")
    && SSE_FLOAT_MODE_P (GET_MODE (operands[0]))
    && GET_MODE (operands[0]) == GET_MODE (operands[1])"
   "* return output_fp_compare (insn, operands, 1, 1);"
-  [(set_attr "type" "fcmp,ssecmp")
+  [(set_attr "type" "fcmp,ssecomi")
    (set (attr "mode")
      (if_then_else (match_operand:SF 1 "" "")
         (const_string "SF")
   "SSE_FLOAT_MODE_P (GET_MODE (operands[0]))
    && GET_MODE (operands[0]) == GET_MODE (operands[1])"
   "* return output_fp_compare (insn, operands, 1, 1);"
-  [(set_attr "type" "ssecmp")
+  [(set_attr "type" "ssecomi")
    (set (attr "mode")
      (if_then_else (match_operand:SF 1 "" "")
         (const_string "SF")
                       (parallel [(const_int 0)]))))]
   "TARGET_SSE"
   "comiss\t{%1, %0|%0, %1}"
-  [(set_attr "type" "ssecmp")
+  [(set_attr "type" "ssecomi")
    (set_attr "mode" "SF")])
 
 (define_insn "sse_ucomi"
                        (parallel [(const_int 0)]))))]
   "TARGET_SSE"
   "ucomiss\t{%1, %0|%0, %1}"
-  [(set_attr "type" "ssecmp")
+  [(set_attr "type" "ssecomi")
    (set_attr "mode" "SF")])
 
 
                       (parallel [(const_int 0)]))))]
   "TARGET_SSE2"
   "comisd\t{%1, %0|%0, %1}"
-  [(set_attr "type" "ssecmp")
+  [(set_attr "type" "ssecomi")
    (set_attr "mode" "DF")])
 
 (define_insn "sse2_ucomi"
                         (parallel [(const_int 0)]))))]
   "TARGET_SSE2"
   "ucomisd\t{%1, %0|%0, %1}"
-  [(set_attr "type" "ssecmp")
+  [(set_attr "type" "ssecomi")
    (set_attr "mode" "DF")])
 
 ;; SSE Strange Moves.
 (define_insn "sse2_unpckhpd"
   [(set (match_operand:V2DF 0 "register_operand" "=x")
        (vec_concat:V2DF
-        (vec_select:V2DF (match_operand:V2DF 1 "register_operand" "0")
-                         (parallel [(const_int 1)]))
-        (vec_select:V2DF (match_operand:V2DF 2 "register_operand" "x")
-                         (parallel [(const_int 0)]))))]
+        (vec_select:DF (match_operand:V2DF 1 "register_operand" "0")
+                       (parallel [(const_int 1)]))
+        (vec_select:DF (match_operand:V2DF 2 "register_operand" "x")
+                       (parallel [(const_int 0)]))))]
   "TARGET_SSE2"
   "unpckhpd\t{%2, %0|%0, %2}"
   [(set_attr "type" "ssecvt")
 (define_insn "sse2_unpcklpd"
   [(set (match_operand:V2DF 0 "register_operand" "=x")
        (vec_concat:V2DF
-        (vec_select:V2DF (match_operand:V2DF 1 "register_operand" "0")
-                         (parallel [(const_int 0)]))
-        (vec_select:V2DF (match_operand:V2DF 2 "register_operand" "x")
-                         (parallel [(const_int 1)]))))]
+        (vec_select:DF (match_operand:V2DF 1 "register_operand" "0")
+                       (parallel [(const_int 0)]))
+        (vec_select:DF (match_operand:V2DF 2 "register_operand" "x")
+                       (parallel [(const_int 1)]))))]
   "TARGET_SSE2"
   "unpcklpd\t{%2, %0|%0, %2}"
   [(set_attr "type" "ssecvt")
index 8f9ac33cc25c6f1c965cb782bac305c36572e1e8..180c31e96358e8d6ef1ee5a74ad4b6dd0ebef015 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -40,6 +40,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "output.h"
 #include "ggc.h"
 #include "timevar.h"
+#include "except.h"
 
 /* The basic idea of common subexpression elimination is to go
    through the code, keeping a record of expressions that would
@@ -6809,6 +6810,8 @@ cse_set_around_loop (x, insn, loop_start)
                       SET_SRC, add an insn after P to copy its destination
                       to what we will be replacing SET_SRC with.  */
                    if (cse_check_loop_start_value
+                       && single_set (p)
+                       && !can_throw_internal (insn)
                        && validate_change (insn, &SET_SRC (x),
                                            src_elt->exp, 0))
                      {