bfin.c (bfin_expand_strmov): Correctly move the trailing bytes when align is 2.
authorJie Zhang <jie.zhang@analog.com>
Fri, 11 Nov 2005 17:58:31 +0000 (17:58 +0000)
committerJie Zhang <jiez@gcc.gnu.org>
Fri, 11 Nov 2005 17:58:31 +0000 (17:58 +0000)
* config/bfin/bfin.c (bfin_expand_strmov): Correctly move the trailing
bytes when align is 2.
* config/bfin/bfin.md (rep_movsi, rep_movhi): Make LSETUP be followed
by the first instruction of the loop.

From-SVN: r106790

gcc/ChangeLog
gcc/config/bfin/bfin.c
gcc/config/bfin/bfin.md

index 7a871c4a26bbaa9233d593a17a0315fe1d89270b..425bc1ae521b882d16afba96ab43c46b5ed2b2b4 100644 (file)
@@ -1,3 +1,10 @@
+2005-11-11  Jie Zhang  <jie.zhang@analog.com>
+
+       * config/bfin/bfin.c (bfin_expand_strmov): Correctly move the trailing
+       bytes when align is 2.
+       * config/bfin/bfin.md (rep_movsi, rep_movhi): Make LSETUP be followed
+       by the first instruction of the loop.
+
 2005-11-11  Jason Merrill  <jason@redhat.com>
 
        PR c++/24686
index be028f74528277f07ead54f06159fa92f7e7d206..f1a82683aa18ea7a4958e89e8a8ce3207ce45157 100644 (file)
@@ -2475,6 +2475,11 @@ bfin_expand_strmov (rtx dst, rtx src, rtx count_exp, rtx align_exp)
 
              emit_insn (gen_rep_movsi (destreg, srcreg, countreg, destreg, srcreg));
            }
+         if (count & 2)
+           {
+             single_move_for_strmov (dst, src, HImode, offset);
+             offset += 2;
+           }
        }
       else
        {
@@ -2491,11 +2496,6 @@ bfin_expand_strmov (rtx dst, rtx src, rtx count_exp, rtx align_exp)
              emit_insn (gen_rep_movhi (destreg, srcreg, countreg, destreg, srcreg));
            }
        }
-      if (count & 2)
-       {
-         single_move_for_strmov (dst, src, HImode, offset);
-         offset += 2;
-       }
       if (count & 1)
        {
          single_move_for_strmov (dst, src, QImode, offset);
index 1bbbacde7645d630ecead5adc582045d647a490c..363a1e9fb7f375b04caf2946120f0449467058b0 100644 (file)
    (use (match_dup 2))
    (clobber (match_scratch:HI 5 "=&d"))]
   ""
-  "lsetup (1f, 1f) LC1 = %2; %5 = [%4++]; 1: MNOP || [%3++] = %5 || %5 = [%4++]; [%3++] = %5;"
+  "%5 = [%4++]; lsetup (1f, 1f) LC1 = %2; 1: MNOP || [%3++] = %5 || %5 = [%4++]; [%3++] = %5;"
   [(set_attr "type" "misc")
    (set_attr "length" "16")])
 
    (use (match_dup 2))
    (clobber (match_scratch:HI 5 "=&d"))]
   ""
-  "lsetup (1f, 1f) LC1 = %2; %h5 = W[%4++]; 1: MNOP || W [%3++] = %5 || %h5 = W [%4++]; W [%3++] = %5;"
+  "%h5 = W[%4++]; lsetup (1f, 1f) LC1 = %2; 1: MNOP || W [%3++] = %5 || %h5 = W [%4++]; W [%3++] = %5;"
   [(set_attr "type" "misc")
    (set_attr "length" "16")])