h8300.c (get_shift_alg): Reorganize the code that deals with 7-bit shifts in HImode.
authorKazu Hirata <kazu@hxi.com>
Wed, 14 Nov 2001 14:28:06 +0000 (14:28 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Wed, 14 Nov 2001 14:28:06 +0000 (14:28 +0000)
* config/h8300/h8300.c (get_shift_alg): Reorganize the code
that deals with 7-bit shifts in HImode.

From-SVN: r47014

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

index d22a17a925709fc5e5ec8ddcf646526166cb4e28..59761d3f514146c2971aaf12e0f7f540d3138b53 100644 (file)
@@ -1,3 +1,8 @@
+2001-11-14  Kazu Hirata  <kazu@hxi.com>
+
+       * config/h8300/h8300.c (get_shift_alg): Reorganize the code
+       that deals with 7-bit shifts in HImode.
+
 Wed Nov 14 14:17:05 CET 2001  Jan Hubicka  <jh@suse.cz>
 
        * dbxout.c (dbxout_symbol_location): Update call of alter_subreg.
index f9783927ab063e7502aebbca643b07d32d057156..ea9c74dc8fe78a971742fe10bb49467e78a0c251 100644 (file)
@@ -2420,32 +2420,21 @@ get_shift_alg (shift_type, shift_mode, count, info)
     case HIshift:
       if (count == 7)
        {
-         if (shift_type == SHIFT_ASHIFT && TARGET_H8300)
-           {
-             info->special = "shar.b\t%t0\n\tmov.b\t%s0,%t0\n\trotxr.b\t%t0\n\trotr.b\t%s0\n\tand.b\t#0x80,%s0";
-             goto end;
-           }
-
-         if (shift_type == SHIFT_ASHIFT && TARGET_H8300H)
-           {
-             info->special = "shar.b\t%t0\n\tmov.b\t%s0,%t0\n\trotxr.w\t%T0\n\tand.b\t#0x80,%s0";
-             goto end;
-           }
-
-         if (shift_type == SHIFT_LSHIFTRT && TARGET_H8300)
+         switch (shift_type)
            {
-             info->special = "shal.b\t%s0\n\tmov.b\t%t0,%s0\n\trotxl.b\t%s0\n\trotl.b\t%t0\n\tand.b\t#0x01,%t0";
+           case SHIFT_ASHIFT:
+             if (TARGET_H8300)
+               info->special = "shar.b\t%t0\n\tmov.b\t%s0,%t0\n\trotxr.b\t%t0\n\trotr.b\t%s0\n\tand.b\t#0x80,%s0";
+             else
+               info->special = "shar.b\t%t0\n\tmov.b\t%s0,%t0\n\trotxr.w\t%T0\n\tand.b\t#0x80,%s0";
              goto end;
-           }
-
-         if (shift_type == SHIFT_LSHIFTRT && TARGET_H8300H)
-           {
-             info->special = "shal.b\t%s0\n\tmov.b\t%t0,%s0\n\trotxl.w\t%T0\n\tand.b\t#0x01,%t0";
+           case SHIFT_LSHIFTRT:
+             if (TARGET_H8300)
+               info->special = "shal.b\t%s0\n\tmov.b\t%t0,%s0\n\trotxl.b\t%s0\n\trotl.b\t%t0\n\tand.b\t#0x01,%t0";
+             else
+               info->special = "shal.b\t%s0\n\tmov.b\t%t0,%s0\n\trotxl.w\t%T0\n\tand.b\t#0x01,%t0";
              goto end;
-           }
-
-         if (shift_type == SHIFT_ASHIFTRT)
-           {
+           case SHIFT_ASHIFTRT:
              info->special = "shal.b\t%s0\n\tmov.b\t%t0,%s0\n\trotxl.b\t%s0\n\tsubx\t%t0,%t0";
              goto end;
            }