public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
To: libc-alpha@sourceware.org
Cc: tuliom@linux.vnet.ibm.com, munroesj@linux.vnet.ibm.com,
	wschmidt@linux.vnet.ibm.com
Subject: _HAVE_STRING_ARCH_strcpy/strncpy and ppc64 macro expansion of strcpy/strncpy.
Date: Wed, 26 Oct 2016 15:05:00 -0000	[thread overview]
Message-ID: <1477494262.5924.13.camel@linux.vnet.ibm.com> (raw)

At present, powerpc uses the generic macros for strcpy/strncpy
expansion, which includes an expansion into code that compares the
strings character by character if one string is a string constant and
is less than 4 chars. 

I'm currently working on builtin expansion of strcmp/strncmp in gcc7
for powerpc, similar to the memcmp builtin expansion I checked in a
couple weeks ago. This will potentialy generate much better code for
these short comparisons because gcc often knows the alignment which
allows it to generate word or doubleword comparisons reducing the
number of branches greatly.

However as things currently stand, comparisons to constant strings < 4
chars never see a strcmp/strncmp call because they get macro expanded
into comparison code. What would be helpful would be a change to have
powerpc specific code that doesn't invoke __strcmp_cg if compiled with
gcc7 or higher.

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-10-26 15:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-26 15:05 Aaron Sawdey [this message]
2016-10-26 18:09 ` Adhemerval Zanella

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=1477494262.5924.13.camel@linux.vnet.ibm.com \
    --to=acsawdey@linux.vnet.ibm.com \
    --cc=libc-alpha@sourceware.org \
    --cc=munroesj@linux.vnet.ibm.com \
    --cc=tuliom@linux.vnet.ibm.com \
    --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).