i386.c (ix86_split_ashl): Rename single_width variable to half_width.
authorUros Bizjak <ubizjak@gmail.com>
Tue, 21 Sep 2010 11:42:06 +0000 (13:42 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Tue, 21 Sep 2010 11:42:06 +0000 (13:42 +0200)
* config/i386/i386.c (ix86_split_ashl): Rename single_width variable
to half_width.  Use GET_MODE_BITSIZE to calculate mode size.
(ix86_split_ashr): Ditto.
(ix86_split_lshr): Ditto.

From-SVN: r164476

gcc/ChangeLog
gcc/config/i386/i386.c

index 7585ee69ac353b424936680f2246a465a3fc2948..97f25e7332294d36d21c208bf4e4c0af8768e786 100644 (file)
@@ -1,3 +1,10 @@
+2010-09-21  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.c (ix86_split_ashl): Rename single_width variable
+       to half_width.  Use GET_MODE_BITSIZE to calculate mode size.
+       (ix86_split_ashr): Ditto.
+       (ix86_split_lshr): Ditto.
+
 2010-09-21  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/45580
index 33dbbe9ca2aba37e184f107073e089a3f88f4402..de1564afb9461e0f0ba67317a1e667f59332c8a7 100644 (file)
@@ -18079,23 +18079,23 @@ ix86_split_ashl (rtx *operands, rtx scratch, enum machine_mode mode)
 {
   rtx (*gen_ashl3)(rtx, rtx, rtx);
   rtx (*gen_shld)(rtx, rtx, rtx);
+  int half_width = GET_MODE_BITSIZE (mode) >> 1;
 
   rtx low[2], high[2];
   int count;
-  const int single_width = mode == DImode ? 32 : 64;
 
   if (CONST_INT_P (operands[2]))
     {
       split_double_mode (mode, operands, 2, low, high);
-      count = INTVAL (operands[2]) & (single_width * 2 - 1);
+      count = INTVAL (operands[2]) & (GET_MODE_BITSIZE (mode) - 1);
 
-      if (count >= single_width)
+      if (count >= half_width)
        {
          emit_move_insn (high[0], low[1]);
          emit_move_insn (low[0], const0_rtx);
 
-         if (count > single_width)
-           ix86_expand_ashl_const (high[0], count - single_width, mode);
+         if (count > half_width)
+           ix86_expand_ashl_const (high[0], count - half_width, mode);
        }
       else
        {
@@ -18124,7 +18124,7 @@ ix86_split_ashl (rtx *operands, rtx scratch, enum machine_mode mode)
 
          ix86_expand_clear (low[0]);
          ix86_expand_clear (high[0]);
-         emit_insn (gen_testqi_ccz_1 (operands[2], GEN_INT (single_width)));
+         emit_insn (gen_testqi_ccz_1 (operands[2], GEN_INT (half_width)));
 
          d = gen_lowpart (QImode, low[0]);
          d = gen_rtx_STRICT_LOW_PART (VOIDmode, d);
@@ -18231,34 +18231,34 @@ ix86_split_ashr (rtx *operands, rtx scratch, enum machine_mode mode)
   rtx (*gen_ashr3)(rtx, rtx, rtx)
     = mode == DImode ? gen_ashrsi3 : gen_ashrdi3;
   rtx (*gen_shrd)(rtx, rtx, rtx);
+  int half_width = GET_MODE_BITSIZE (mode) >> 1;
 
   rtx low[2], high[2];
   int count;
-  const int single_width = mode == DImode ? 32 : 64;
 
   if (CONST_INT_P (operands[2]))
     {
       split_double_mode (mode, operands, 2, low, high);
-      count = INTVAL (operands[2]) & (single_width * 2 - 1);
+      count = INTVAL (operands[2]) & (GET_MODE_BITSIZE (mode) - 1);
 
-      if (count == single_width * 2 - 1)
+      if (count == GET_MODE_BITSIZE (mode) - 1)
        {
          emit_move_insn (high[0], high[1]);
          emit_insn (gen_ashr3 (high[0], high[0],
-                               GEN_INT (single_width - 1)));
+                               GEN_INT (half_width - 1)));
          emit_move_insn (low[0], high[0]);
 
        }
-      else if (count >= single_width)
+      else if (count >= half_width)
        {
          emit_move_insn (low[0], high[1]);
          emit_move_insn (high[0], low[0]);
          emit_insn (gen_ashr3 (high[0], high[0],
-                               GEN_INT (single_width - 1)));
+                               GEN_INT (half_width - 1)));
 
-         if (count > single_width)
+         if (count > half_width)
            emit_insn (gen_ashr3 (low[0], low[0],
-                                 GEN_INT (count - single_width)));
+                                 GEN_INT (count - half_width)));
        }
       else
        {
@@ -18290,7 +18290,7 @@ ix86_split_ashr (rtx *operands, rtx scratch, enum machine_mode mode)
 
          emit_move_insn (scratch, high[0]);
          emit_insn (gen_ashr3 (scratch, scratch,
-                               GEN_INT (single_width - 1)));
+                               GEN_INT (half_width - 1)));
          emit_insn (gen_x86_shift_adj_1 (low[0], high[0], operands[2],
                                          scratch));
        }
@@ -18310,24 +18310,24 @@ ix86_split_lshr (rtx *operands, rtx scratch, enum machine_mode mode)
   rtx (*gen_lshr3)(rtx, rtx, rtx)
     = mode == DImode ? gen_lshrsi3 : gen_lshrdi3;
   rtx (*gen_shrd)(rtx, rtx, rtx);
+  int half_width = GET_MODE_BITSIZE (mode) >> 1;
 
   rtx low[2], high[2];
   int count;
-  const int single_width = mode == DImode ? 32 : 64;
 
   if (CONST_INT_P (operands[2]))
     {
       split_double_mode (mode, operands, 2, low, high);
-      count = INTVAL (operands[2]) & (single_width * 2 - 1);
+      count = INTVAL (operands[2]) & (GET_MODE_BITSIZE (mode) - 1);
 
-      if (count >= single_width)
+      if (count >= half_width)
        {
          emit_move_insn (low[0], high[1]);
          ix86_expand_clear (high[0]);
 
-         if (count > single_width)
+         if (count > half_width)
            emit_insn (gen_lshr3 (low[0], low[0],
-                                 GEN_INT (count - single_width)));
+                                 GEN_INT (count - half_width)));
        }
       else
        {