From patchwork Sun Mar 11 01:06:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 145923 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id AC016B6FA4 for ; Sun, 11 Mar 2012 12:06:41 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1332032803; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=opwHEtrd1yv5Bd3+PDMIm5rS2SA=; b=FfkssJpFAvs7719b/03rrOXroq55O46ANh9jMUfqKdgj5Y+kX7kgD16SbKd+Bj ywrjZ6x4qITjna/3/SQTRXE6X00wRYmRMxKr0hCwwbvlWxkesY/pqZFYN2ciJ1i6 H8L+K/5wU3xgZQbVtQkzvlLls2zIM/cgbLxKeC27PQhkg= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=oY/ZYWaWlCfxwcRGRuJzdRjuVAtZD6PaaIj0x7i3OMwD1m8XDe1Nv2CcmLHIxw CENnJgwslybsCeWFhyVY78d4YiHUAUdcBQQioGOtpw2gVSrbehPhvhFyOkDwnYgU 7CAR6PwWpOuCNL1+dr7CKjUnm/rg18IW+510PQgmJa4lg=; Received: (qmail 4526 invoked by alias); 11 Mar 2012 01:06:36 -0000 Received: (qmail 4518 invoked by uid 22791); 11 Mar 2012 01:06:35 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-yx0-f175.google.com (HELO mail-yx0-f175.google.com) (209.85.213.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 11 Mar 2012 01:06:21 +0000 Received: by yenm3 with SMTP id m3so1869198yen.20 for ; Sat, 10 Mar 2012 17:06:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.135.82 with SMTP id m18mr908562qct.136.1331427980624; Sat, 10 Mar 2012 17:06:20 -0800 (PST) Received: by 10.229.89.137 with HTTP; Sat, 10 Mar 2012 17:06:20 -0800 (PST) In-Reply-To: References: <20120302210253.GA2459@intel.com> Date: Sat, 10 Mar 2012 17:06:20 -0800 Message-ID: Subject: Re: [PATCH 07/10] addr32: Use word_mode instead of Pmode in loop expand From: "H.J. Lu" To: Uros Bizjak Cc: gcc-patches@gcc.gnu.org, Richard Henderson , Jan Hubicka X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Thu, Mar 8, 2012 at 3:22 AM, Uros Bizjak wrote: > On Fri, Mar 2, 2012 at 10:02 PM, H.J. Lu 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   >> >>        * 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? > Here is a complete updated patch to use word_mode in ix86_expand_movmem and ix86_expand_setmem. It also fixes ix86_zero_extend_to_Pmode to handle Pmode != DImode. OK for trunk? Thanks. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index bc144a9..a51c6b4 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -21031,7 +21031,11 @@ ix86_zero_extend_to_Pmode (rtx exp) if (GET_MODE (exp) == Pmode) return copy_to_mode_reg (Pmode, exp); r = gen_reg_rtx (Pmode); - emit_insn (gen_zero_extendsidi2 (r, exp)); + if (Pmode == DImode) + emit_insn (gen_zero_extendsidi2 (r, exp)); + else + emit_move_insn (r, + simplify_gen_subreg (Pmode, exp, GET_MODE (exp), 0)); return r; } @@ -22060,11 +22064,11 @@ ix86_expand_movmem (rtx dst, rtx src, rtx count_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) * (TARGET_64BIT ? 4 : 2); + size_needed = GET_MODE_SIZE (word_mode) * (TARGET_64BIT ? 4 : 2); break; case rep_prefix_8_byte: size_needed = 8; @@ -22230,13 +22234,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: @@ -22448,11 +22452,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; @@ -22623,11 +22627,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,