]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/54089 ([SH] Refactor shift patterns)
authorOleg Endo <olegendo@gcc.gnu.org>
Thu, 16 Aug 2012 23:13:11 +0000 (23:13 +0000)
committerOleg Endo <olegendo@gcc.gnu.org>
Thu, 16 Aug 2012 23:13:11 +0000 (23:13 +0000)
PR target/54089
* config/sh/sh.md (ashlsi3_d): Do not split if it would result
in a T_REG clobber.  Correct comment.
(ashlsi3_n): Correct comment.

From-SVN: r190457

gcc/ChangeLog
gcc/config/sh/sh.md

index 0d094a4bcfc730427d96458a72718950bfb2e32d..af3bb6f8b7488c91f6126a2b353fd1e0afa8d990 100644 (file)
@@ -1,4 +1,11 @@
-2012-08-17  Hans-Peter Nilsson  <hp@axis.com>
+2012-08-16  Oleg Endo  <olegendo@gcc.gnu.org>
+
+       PR target/54089
+       * config/sh/sh.md (ashlsi3_d): Do not split if it would result
+       in a T_REG clobber.  Correct comment.
+       (ashlsi3_n): Correct comment.
+
+2012-08-16  Hans-Peter Nilsson  <hp@axis.com>
 
        PR middle-end/54261
        * optabs.c (expand_atomic_fetch_op): Save and restore code when
index 5d6fc84a3a7a82f123dda8094a12efaf9d399aba..f3c0a8e023a443b387aefdc1a26408605d42dba2 100644 (file)
@@ -3746,7 +3746,8 @@ label:
                   (match_operand:SI 2 "shift_count_operand" "r")))]
   "TARGET_DYNSHIFT"
   "shld        %2,%0"
-  "&& (CONST_INT_P (operands[2]) && ! sh_dynamicalize_shift_p (operands[2]))"
+  "&& CONST_INT_P (operands[2]) && ! sh_dynamicalize_shift_p (operands[2])
+   && ! sh_ashlsi_clobbers_t_reg_p (operands[2])"
   [(const_int 0)]
 {
   if (satisfies_constraint_P27 (operands[2]))
@@ -3759,7 +3760,9 @@ label:
       /* This must happen before reload, otherwise the constant will be moved
         into a register due to the "r" constraint, after which this split
         cannot be done anymore.
-        Unfortunately the move insn will not always be eliminated.  */
+        Unfortunately the move insn will not always be eliminated.
+        Also, here we must not create a shift sequence that clobbers the
+        T_REG.  */
       emit_move_insn (operands[0], operands[1]);
       gen_shifty_op (ASHIFT, operands);
       DONE;
@@ -3782,8 +3785,7 @@ label:
   if (sh_dynamicalize_shift_p (operands[2]) && can_create_pseudo_p ())
     {
       /* If this pattern was picked and dynamic shifts are supported, switch
-        to dynamic shift pattern before reload.  However, we must not
-        create a shift sequence that clobbers the T_REG.  */
+        to dynamic shift pattern before reload.  */
       operands[2] = force_reg (SImode, operands[2]);
       emit_insn (gen_ashlsi3_d (operands[0], operands[1], operands[2]));
     }