2005-09-06 Saurabh Verma <saurabh.verma@codito.com>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Sep 2005 22:26:59 +0000 (22:26 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Sep 2005 22:26:59 +0000 (22:26 +0000)
        PR target/8972
        * config/arc/arc.c (output_shift): Add check for loop count when
        optimizing.

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

gcc/ChangeLog
gcc/config/arc/arc.c

index c0eb165..96d6d60 100644 (file)
@@ -1,3 +1,9 @@
+2005-09-06  Saurabh Verma  <saurabh.verma@codito.com>
+
+       PR target/8972
+       * config/arc/arc.c (output_shift): Add check for loop count when
+       optimizing.
+
 2005-09-06  Steven Bosscher  <stevenb@suse.de>
 
        * tree-ssa-phiopt.c (conditional_replacement): Construct proper SSA
index 2adf01d..6d8666e 100644 (file)
@@ -1494,7 +1494,11 @@ output_shift (rtx *operands)
   if (GET_CODE (operands[2]) != CONST_INT)
     {
       if (optimize)
-       output_asm_insn ("mov lp_count,%2", operands);
+       {
+         output_asm_insn ("sub.f 0,%2,0", operands);
+         output_asm_insn ("mov lp_count,%2", operands);
+         output_asm_insn ("bz 2f", operands);
+       }
       else
        output_asm_insn ("mov %4,%2", operands);
       goto shiftloop;
@@ -1568,6 +1572,8 @@ output_shift (rtx *operands)
                fprintf (asm_out_file, "1:\t%s single insn loop\n",
                         ASM_COMMENT_START);
              output_asm_insn (shift_one, operands);
+             fprintf (asm_out_file, "2:\t%s end single insn loop\n",
+                      ASM_COMMENT_START);
            }
          else 
            {