This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

_HAVE_STRING_ARCH_strcpy/strncpy and ppc64 macro expansion of strcpy/strncpy.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]