diff mbox

[07/10] addr32: Use word_mode instead of Pmode in loop expand

Message ID 20120302210253.GA2459@intel.com
State New
Headers show

Commit Message

H.J. Lu March 2, 2012, 9:02 p.m. UTC
Hi,

This patches uses word_mode instead of Pmode in loop expand since
word_mode may have bigger size than Pmode.  OK for trunk?

Thanks.

H.J.
---
2012-03-02  H.J. Lu  <hongjiu.lu@intel.com>

	* config/i386/i386.c (ix86_expand_movmem): Use word_mode instead
	of Pmode on loop.
	(ix86_expand_setmem): Likwise.

Comments

Uros Bizjak March 8, 2012, 11:22 a.m. UTC | #1
On Fri, Mar 2, 2012 at 10:02 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:

> This patches uses word_mode instead of Pmode in loop expand since
> word_mode may have bigger size than Pmode.  OK for trunk?
>
> Thanks.
>
> H.J.
> ---
> 2012-03-02  H.J. Lu  <hongjiu.lu@intel.com>
>
>        * config/i386/i386.c (ix86_expand_movmem): Use word_mode instead
>        of Pmode on loop.
>        (ix86_expand_setmem): Likwise.

Jan, can you please comment on the changes in this patch?

Thanks,
Uros.
diff mbox

Patch

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 47fa36a..67aaaea 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -22239,13 +22239,13 @@  ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp,
       break;
     case loop:
       expand_set_or_movmem_via_loop (dst, src, destreg, srcreg, NULL,
-				     count_exp, Pmode, 1, expected_size);
+				     count_exp, word_mode, 1, expected_size);
       break;
     case unrolled_loop:
       /* Unroll only by factor of 2 in 32bit mode, since we don't have enough
 	 registers for 4 temporaries anyway.  */
       expand_set_or_movmem_via_loop (dst, src, destreg, srcreg, NULL,
-				     count_exp, Pmode, TARGET_64BIT ? 4 : 2,
+				     count_exp, word_mode, TARGET_64BIT ? 4 : 2,
 				     expected_size);
       break;
     case rep_prefix_8_byte:
@@ -22457,11 +22457,11 @@  ix86_expand_setmem (rtx dst, rtx count_exp, rtx val_exp, rtx align_exp,
       gcc_unreachable ();
     case loop:
       need_zero_guard = true;
-      size_needed = GET_MODE_SIZE (Pmode);
+      size_needed = GET_MODE_SIZE (word_mode);
       break;
     case unrolled_loop:
       need_zero_guard = true;
-      size_needed = GET_MODE_SIZE (Pmode) * 4;
+      size_needed = GET_MODE_SIZE (word_mode) * 4;
       break;
     case rep_prefix_8_byte:
       size_needed = 8;
@@ -22632,11 +22632,11 @@  ix86_expand_setmem (rtx dst, rtx count_exp, rtx val_exp, rtx align_exp,
       break;
     case loop:
       expand_set_or_movmem_via_loop (dst, NULL, destreg, NULL, promoted_val,
-				     count_exp, Pmode, 1, expected_size);
+				     count_exp, word_mode, 1, expected_size);
       break;
     case unrolled_loop:
       expand_set_or_movmem_via_loop (dst, NULL, destreg, NULL, promoted_val,
-				     count_exp, Pmode, 4, expected_size);
+				     count_exp, word_mode, 4, expected_size);
       break;
     case rep_prefix_8_byte:
       expand_setmem_via_rep_stos (dst, destreg, promoted_val, count_exp,