h8300.c (get_shift_alg): Make shift insn sequences end with a valid cc0 whenever...
authorKazu Hirata <kazu@cs.umass.edu>
Sun, 22 Dec 2002 15:02:30 +0000 (15:02 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sun, 22 Dec 2002 15:02:30 +0000 (15:02 +0000)
* config/h8300/h8300.c (get_shift_alg): Make shift insn
sequences end with a valid cc0 whenever possible.

From-SVN: r60406

gcc/ChangeLog
gcc/config/h8300/h8300.c

index b59abe05f5f2dbd3fd8216e3cf02c10b0e958a59..58962a017eede7ccb71b7c6ad25a9a0611031477 100644 (file)
@@ -1,3 +1,8 @@
+2002-12-22  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * config/h8300/h8300.c (get_shift_alg): Make shift insn
+       sequences end with a valid cc0 whenever possible.
+
 2002-12-22  Kazu Hirata  <kazu@cs.umass.edu>
 
        * config/h8300/h8300.md (negsf2): New.
index c13b247ec75a99260dd5cbdaf92eff0f749f11f1..0eb973dc078f5db059f2690631f2413965afc1dc 100644 (file)
@@ -2590,21 +2590,29 @@ get_shift_alg (shift_type, shift_mode, count, info)
            {
            case SHIFT_ASHIFT:
              info->special = "mov.b\t%s0,%t0\n\tsub.b\t%s0,%s0";
-             info->shift1  = "shal.b\t%t0";
-             info->shift2  = "shal.b\t#2,%t0";
              goto end;
            case SHIFT_LSHIFTRT:
-             info->special = "mov.b\t%t0,%s0\n\tsub.b\t%t0,%t0";
-             info->shift1  = "shlr.b\t%s0";
-             info->shift2  = "shlr.b\t#2,%s0";
+             if (TARGET_H8300)
+               {
+                 info->special = "mov.b\t%t0,%s0\n\tsub.b\t%t0,%t0";
+                 info->shift1  = "shlr.b\t%s0";
+               }
+             else
+               {
+                 info->special = "mov.b\t%t0,%s0\n\textu.w\t%T0";
+               }
              goto end;
            case SHIFT_ASHIFTRT:
              if (TARGET_H8300)
-               info->special = "mov.b\t%t0,%s0\n\tbld\t#7,%s0\n\tsubx\t%t0,%t0";
+               {
+                 info->special = "mov.b\t%t0,%s0\n\tbld\t#7,%s0\n\tsubx\t%t0,%t0";
+                 info->shift1  = "shar.b\t%s0";
+                 info->shift2  = "shar.b\t#2,%s0";
+               }
              else
-               info->special = "mov.b\t%t0,%s0\n\texts.w\t%T0";
-             info->shift1 = "shar.b\t%s0";
-             info->shift2 = "shar.b\t#2,%s0";
+               {
+                 info->special = "mov.b\t%t0,%s0\n\texts.w\t%T0";
+               }
              goto end;
            }
        }
@@ -2730,15 +2738,14 @@ get_shift_alg (shift_type, shift_mode, count, info)
                }
              goto end;
            case SHIFT_LSHIFTRT:
-             info->special = "mov.w\t%e0,%f0\n\tsub.w\t%e0,%e0";
              if (TARGET_H8300)
                {
-                 info->shift1 = "shlr\t%x0\n\trotxr\t%w0";
+                 info->special = "mov.w\t%e0,%f0\n\tsub.w\t%e0,%e0";
+                 info->shift1  = "shlr\t%x0\n\trotxr\t%w0";
                }
              else
                {
-                 info->shift1 = "shlr.l\t%S0";
-                 info->shift2 = "shlr.l\t#2,%S0";
+                 info->special = "mov.w\t%e0,%f0\n\textu.l\t%S0";
                }
              goto end;
            case SHIFT_ASHIFTRT:
@@ -2750,8 +2757,6 @@ get_shift_alg (shift_type, shift_mode, count, info)
              else
                {
                  info->special = "mov.w\t%e0,%f0\n\texts.l\t%S0";
-                 info->shift1  = "shar.l\t%S0";
-                 info->shift2  = "shar.l\t#2,%S0";
                }
              goto end;
            }
@@ -2814,9 +2819,9 @@ get_shift_alg (shift_type, shift_mode, count, info)
              goto end;
            case SHIFT_LSHIFTRT:
              if (TARGET_H8300H)
-               info->special = "sub.w\t%f0,%f0\n\trotl.l\t%S0\n\trotl.l\t%S0\n\trotl.l\t%S0\n\trotl.l\t%S0\n\tsub.w\t%e0,%e0";
+               info->special = "sub.w\t%f0,%f0\n\trotl.l\t%S0\n\trotl.l\t%S0\n\trotl.l\t%S0\n\trotl.l\t%S0\n\textu.l\t%S0";
              else
-               info->special = "sub.w\t%f0,%f0\n\trotl.l\t#2,%S0\n\trotl.l\t#2,%S0\n\tsub.w\t%e0,%e0";
+               info->special = "sub.w\t%f0,%f0\n\trotl.l\t#2,%S0\n\trotl.l\t#2,%S0\n\textu.l\t%S0";
              info->shift1  = "";
              info->shift2  = "";
              goto end;
@@ -2838,9 +2843,9 @@ get_shift_alg (shift_type, shift_mode, count, info)
              goto end;
            case SHIFT_LSHIFTRT:
              if (TARGET_H8300H)
-               info->special = "sub.w\t%f0,%f0\n\trotl.l\t%S0\n\trotl.l\t%S0\n\trotl.l\t%S0\n\tsub.w\t%e0,%e0";
+               info->special = "sub.w\t%f0,%f0\n\trotl.l\t%S0\n\trotl.l\t%S0\n\trotl.l\t%S0\n\textu.l\t%S0";
              else
-               info->special = "sub.w\t%f0,%f0\n\trotl.l\t#2,%S0\n\trotl.l\t%S0\n\tsub.w\t%e0,%e0";
+               info->special = "sub.w\t%f0,%f0\n\trotl.l\t#2,%S0\n\trotl.l\t%S0\n\textu.l\t%S0";
              info->shift1  = "";
              info->shift2  = "";
              goto end;
@@ -2862,9 +2867,9 @@ get_shift_alg (shift_type, shift_mode, count, info)
              goto end;
            case SHIFT_LSHIFTRT:
              if (TARGET_H8300H)
-               info->special = "sub.w\t%f0,%f0\n\trotl.l\t%S0\n\trotl.l\t%S0\n\tsub.w\t%e0,%e0";
+               info->special = "sub.w\t%f0,%f0\n\trotl.l\t%S0\n\trotl.l\t%S0\n\textu.l\t%S0";
              else
-               info->special = "sub.w\t%f0,%f0\n\trotl.l\t#2,%S0\n\tsub.w\t%e0,%e0";
+               info->special = "sub.w\t%f0,%f0\n\trotl.l\t#2,%S0\n\textu.l\t%S0";
              info->shift1  = "";
              info->shift2  = "";
              goto end;
@@ -2900,7 +2905,7 @@ get_shift_alg (shift_type, shift_mode, count, info)
                  info->special = "shll.l\t%S0\n\txor.l\t%S0,%S0\n\trotxl.l\t%S0";
                  goto end;
                case SHIFT_ASHIFTRT:
-                 info->special = "shll\t%e0\n\tsubx\t%w0,%w0\n\tmov.b\t%w0,%x0\n\tmov.w\t%f0,%e0";
+                 info->special = "shll\t%e0\n\tsubx\t%w0,%w0\n\texts.w\t%T0\n\texts.l\t%S0";
                  goto end;
                }
            }