From patchwork Sun Mar 11 15:53:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 145986 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 D66FEB6EE7 for ; Mon, 12 Mar 2012 02:54:16 +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=1332086057; 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=2frGhtkrZRbvj+kyqJ99LimWQlw=; b=XM3L1dtbYefc+X/x13OuvuIjbpDDIkOairbq36U1gN6qD7bZmsDI9uf9QbtMDn cAMmOOVKDUkpq5u+djcvKh1f4S3wddximqlp+LvRDLf6mZ+gS3D5Jp2y4c1zqlJh AWajS9Z16ad59MBQ/ZCNvhJBlcBdRTPS2PVcRYd2335WU= 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:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=EJcEQsYQ9U9EDkO2+y/pl831TigfKVal6Sk4fX9oTop1yQulpTLpQhzvYna8X3 MbpfAvSTs/wwFim9Hsl/0I6EtPbzNjzffslGjAAgDbBQ+Sbqc3g612qG7NL+YoXx bo2P/I68jOX8PGtzfaRs/tZzLirXagiz+XXZjb/pMRnc0=; Received: (qmail 6947 invoked by alias); 11 Mar 2012 15:54:12 -0000 Received: (qmail 6937 invoked by uid 22791); 11 Mar 2012 15:54:11 -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-yw0-f47.google.com (HELO mail-yw0-f47.google.com) (209.85.213.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 11 Mar 2012 15:53:54 +0000 Received: by yhjj56 with SMTP id j56so2051005yhj.20 for ; Sun, 11 Mar 2012 08:53:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.138.110 with SMTP id z74mr10024781yhi.114.1331481234385; Sun, 11 Mar 2012 08:53:54 -0700 (PDT) Received: by 10.146.241.18 with HTTP; Sun, 11 Mar 2012 08:53:54 -0700 (PDT) In-Reply-To: References: <20120302210253.GA2459@intel.com> Date: Sun, 11 Mar 2012 16:53:54 +0100 Message-ID: Subject: Re: [PATCH 07/10] addr32: Use word_mode instead of Pmode in loop expand From: Uros Bizjak To: "H.J. Lu" Cc: gcc-patches@gcc.gnu.org, Richard Henderson , Jan Hubicka 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 Sun, Mar 11, 2012 at 3:30 PM, Uros Bizjak 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? > > Please rewrite ix86_zero_extend_to_Pmode to something like: >  rtx tmp; >  if (GET_MODE (exp) != Pmode) >    tmp = convert_to_mode (Pmode, exp, 1); >  return force_reg (Pmode, tmp)); I am testing attached patch: 2012-03-11 Uros Bizjak * config/i386/i386.c (ix86_zero_extend_to_Pmode): Rewrite using convert_to_mode. (ix86_expand_call): Use force_reg istead of copy_to_mode_reg. Uros. > Uros. Index: i386.c =================================================================== --- i386.c (revision 185193) +++ i386.c (working copy) @@ -21025,14 +21025,9 @@ ix86_adjust_counter (rtx countreg, HOST_WIDE_INT v rtx ix86_zero_extend_to_Pmode (rtx exp) { - rtx r; - if (GET_MODE (exp) == VOIDmode) - return force_reg (Pmode, 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)); - return r; + if (GET_MODE (exp) != Pmode) + exp = convert_to_mode (Pmode, exp, 1); + return force_reg (Pmode, exp); } /* Divide COUNTREG by SCALE. */ @@ -22996,7 +22991,7 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx call fnaddr = XEXP (fnaddr, 0); if (GET_MODE (fnaddr) != word_mode) fnaddr = convert_to_mode (word_mode, fnaddr, 1); - fnaddr = gen_rtx_MEM (QImode, copy_to_mode_reg (word_mode, fnaddr)); + fnaddr = gen_rtx_MEM (QImode, force_reg (word_mode, fnaddr)); } vec_len = 0;