From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26989 invoked by alias); 12 Oct 2007 16:40:37 -0000 Received: (qmail 26938 invoked by uid 22791); 12 Oct 2007 16:40:36 -0000 X-Spam-Check-By: sourceware.org Received: from sccrmhc12.comcast.net (HELO sccrmhc12.comcast.net) (204.127.200.82) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 12 Oct 2007 16:40:29 +0000 Received: from lucon.org ([24.6.230.138]) by comcast.net (sccrmhc12) with ESMTP id <2007101216402701200eb7joe>; Fri, 12 Oct 2007 16:40:27 +0000 Received: by lucon.org (Postfix, from userid 500) id 0CA1EF82E4; Fri, 12 Oct 2007 09:40:27 -0700 (PDT) Date: Fri, 12 Oct 2007 16:40:00 -0000 From: "H.J. Lu" To: Uros Bizjak , GCC Patches , Jan Hubicka Subject: Re: [PATCH,i386] fix PR 11001 Message-ID: <20071012164026.GA1318@lucon.org> References: <5787cf470710032334y2aefe839x8981f4c84b9a2662@mail.gmail.com> <20071004205533.GG4491@codesourcery.com> <5787cf470710042259x3428b010y7d8bb8ac189157a0@mail.gmail.com> <20071012161246.GE11809@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071012161246.GE11809@codesourcery.com> User-Agent: Mutt/1.5.14 (2007-02-12) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-10/txt/msg00742.txt.bz2 On Fri, Oct 12, 2007 at 09:12:47AM -0700, Nathan Froyd wrote: > On Fri, Oct 05, 2007 at 07:59:04AM +0200, Uros Bizjak wrote: > > Sorry for not being clear here. TARGET_INLINE_ALL_STRINGOPS* should be > > respected, and libcalls should not be generated in this case. For > > example, we use -minline-all-stringops to build crtfastmath.o. For > > some targets, we don't want to link against libc to use memset > > routine. > > > > The patch is OK with above change, but please wait a day or two for > > possilbe comments from Jan, as he is the original author of stringops > > code. > > Thanks, the below is what I committed. > > -Nathan > > gcc/ > PR 11001 > * config/i386/i386.md (strmov): Check for esi and edi usage. > * config/i386/i386.c (decide_alg): Check whether we can use a > rep prefix and adjust algorithm choice accordingly. > (ix86_expand_strlen): Check for eax, ecx, and edi usage. > > Index: gcc/config/i386/i386.c > =================================================================== > --- gcc/config/i386/i386.c (revision 129263) > +++ gcc/config/i386/i386.c (working copy) > @@ -15056,21 +15056,32 @@ decide_alg (HOST_WIDE_INT count, HOST_WI > int *dynamic_check) > { > const struct stringop_algs * algs; > + /* Algorithms using the rep prefix want at least edi and ecx; > + additionally, memset wants eax and memcpy wants esi. Don't > + consider such algorithms if the user has appropriated those > + registers for their own purposes. */ > + bool rep_prefix_usable = !(global_regs[2] || global_regs[5] > + || (memset ? global_regs[0] : global_regs[4])); > + > + > + /* Can't use this if the user has appropriated eax, ecx, or edi. */ > + if (global_regs[0] || global_regs[2] || global_regs[5]) > + return false; > + Can you use/add AX_REG, CX_REG, DI_REG, SI_REG instead using 0, 2, 4, 5? Thanks. H.J.