* h8300.c (get_shift_alg): Add special cases for shifts of 8 and 24.
authorJuha Sarlin <juha@c3l.tyreso.se>
Wed, 10 Jun 1998 00:41:51 +0000 (02:41 +0200)
committerJeff Law <law@gcc.gnu.org>
Wed, 10 Jun 1998 00:41:51 +0000 (18:41 -0600)
From-SVN: r20396

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

index db2fa7d2d31ce714a056f0a4db99b2dd019f20aa..18b99650e55889bf4ef02730a69e87bdba6ba00b 100644 (file)
@@ -1,3 +1,7 @@
+Wed Jun 10 01:39:00 1998  Juha Sarlin <juha@c3l.tyreso.se> 
+
+       * h8300.c (get_shift_alg): Add special cases for shifts of 8 and 24.
+
 Tue Jun  9 22:05:34 1998  Richard Henderson  <rth@cygnus.com>
 
        * fold-const.c (fold): Even with otherwise constant trees, look for
index 8ff9ec460f9a6a0a0f07089244d86a489d3cab4f..a3af135f42686430fcc21d8e97d8304ab02d1dfd 100644 (file)
@@ -1,5 +1,5 @@
 /* Subroutines for insn-output.c for Hitachi H8/300.
-   Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
    Contributed by Steve Chamberlain (sac@cygnus.com),
    Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com).
 
@@ -2378,6 +2378,24 @@ get_shift_alg (cpu, shift_type, mode, count, assembler_p,
              return SHIFT_SPECIAL;
            }
        }
+      else if (count == 8 && !TARGET_H8300)
+       {
+         switch (shift_type)
+           {
+           case SHIFT_ASHIFT:
+             *assembler_p = "mov.w\t%e0,%f4\n\tmov.b\t%s4,%t4\n\tmov.b\t%t0,%s4\n\tmov.b\t%s0,%t0\n\tsub.b\t%s0,%s0\n\tmov.w\t%f4,%e0";
+             *cc_valid_p = 0;
+             return SHIFT_SPECIAL;
+           case SHIFT_LSHIFTRT:
+             *assembler_p = "mov.w\t%e0,%f4\n\tmov.b\t%t0,%s0\n\tmov.b\t%s4,%t0\n\tmov.b\t%t4,%s4\n\textu.w\t%f4\n\tmov.w\t%f4,%e0";
+             *cc_valid_p = 0;
+             return SHIFT_SPECIAL;
+           case SHIFT_ASHIFTRT:
+             *assembler_p = "mov.w\t%e0,%f4\n\tmov.b\t%t0,%s0\n\tmov.b\t%s4,%t0\n\tmov.b\t%t4,%s4\n\texts.w\t%f4\n\tmov.w\t%f4,%e0";
+             *cc_valid_p = 0;
+             return SHIFT_SPECIAL;
+           }
+       }
       else if (count == 16)
        {
          switch (shift_type)
@@ -2489,6 +2507,24 @@ get_shift_alg (cpu, shift_type, mode, count, assembler_p,
              return SHIFT_SPECIAL;
            }
        }
+      else if (count == 24 && !TARGET_H8300)
+       {
+         switch (shift_type)
+           {
+           case SHIFT_ASHIFT:
+             *assembler_p = "mov.b\t%s0,%t0\n\tsub.b\t%s0,%s0\n\tmov.w\t%f0,%e0\n\tsub.w\t%f0,%f0";
+             *cc_valid_p = 0;
+             return SHIFT_SPECIAL;
+           case SHIFT_LSHIFTRT:
+             *assembler_p = "mov.w\t%e0,%f0\n\tmov.b\t%t0,%s0\n\textu.w\t%f0\n\textu.l\t%S0";
+             *cc_valid_p = 0;
+             return SHIFT_SPECIAL;
+           case SHIFT_ASHIFTRT:
+             *assembler_p = "mov.w\t%e0,%f0\n\tmov.b\t%t0,%s0\n\texts.w\t%f0\n\texts.l\t%S0";
+             *cc_valid_p = 0;
+             return SHIFT_SPECIAL;
+           }
+       }
       else if (count >= 28 && count <= 30 && !TARGET_H8300)
        {
          if (shift_type == SHIFT_ASHIFTRT)