public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
To: Bernd Schmidt <bschmidt@redhat.com>, gcc-patches@gcc.gnu.org
Cc: Richard Sandiford <rdsandiford@googlemail.com>,
	       Segher Boessenkool	 <segher@kernel.crashing.org>,
	       Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Subject: Re: [RFC PATCH] expand_strn_compare should attempt expansion even if neither string is constant
Date: Wed, 02 Nov 2016 13:38:00 -0000	[thread overview]
Message-ID: <1478093912.9676.72.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <323ce062-3ddf-a8e4-9b5f-c742f2afa188@redhat.com>

On Wed, 2016-11-02 at 13:41 +0100, Bernd Schmidt wrote:
> On 10/27/2016 03:14 AM, Aaron Sawdey wrote:
> > 
> > I'm currently working on a builtin expansion of strncmp for powerpc
> > similar to the one for memcmp I checked recently. One thing I
> > encountered is that the code in expand_strn_compare will not
> > attempt to
> > expand the cmpstrnsi pattern at all if neither string parameter is
> > a
> > constant string. This doesn't make a lot of sense in light of the
> > fact
> > that expand_str_compare starts with an attempt to expand cmpstrsi
> > and
> > then if that does not work, looks at the string args to see if one
> > is
> > constant so it can use cmpstrnsi with the known length.
> > 
> > The attached patch is my attempt to add this fallback path to
> > expand_strn_compare, i.e. if neither length is known, just attempt
> > expansion of cmpstrnsi using the given 3 arguments.
> > 
> > It looks like in addition to rs6000, there are 3 other targets that
> > have cmpstrnsi patterns: i386, sh, and rx.
> > 
> > Is this a reasonable approach to take with this? If so I'll
> > bootstrap/regtest on i386 as rs6000 does not as yet have an
> > expansion
> > for cmpstrsi or cmpstrnsi.
> 
> Just to be sure, this is superseded by your later patch series,
> correct?
> 
> (After I saw this one I had been trying to remember what exactly the 
> i386 issue was but it looks like you found it yourself.)
> 
> 
> Bernd

Yes, the later patch series replaces this preliminary patch. And yes,
the i386 issue took some headscratching and careful reading of the arch
manual on what repz cmpsb actually does.

Thanks,
   Aaron

-- 
Aaron Sawdey, Ph.D.  acsawdey@linux.vnet.ibm.com
050-2/C113  (507) 253-7520 home: 507/263-0782
IBM Linux Technology Center - PPC Toolchain

      reply	other threads:[~2016-11-02 13:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-27  1:14 Aaron Sawdey
2016-11-02 12:41 ` Bernd Schmidt
2016-11-02 13:38   ` Aaron Sawdey [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1478093912.9676.72.camel@linux.vnet.ibm.com \
    --to=acsawdey@linux.vnet.ibm.com \
    --cc=bschmidt@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rdsandiford@googlemail.com \
    --cc=segher@kernel.crashing.org \
    --cc=wschmidt@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).