This is the mail archive of the libc-help@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]

Re: PowerPC e6500 optimized memcmp function - Query


Hi,

You should add the implementation at sysdeps/powerpc/powerpc64/e6500/memcmp.{S,c}
to avoid multiple symbol definition.  This will make glibc select this implementation
only if you configure it with --with-cpu=e6500 and --disable-multiarch.

To enabled it for multiarch you will need to:

 1. Update sysdeps/powerpc/powerpc64/multiarch/memcmp.c to test the correct hwcap 
    flag and return the e6500 function pointer.
 2. Add a new file sysdeps/powerpc/powerpc64/multiarch/memcmp-e6500.S following the
    others multiarch implementation.  Basically you will need to redefine EALIGN/ENTRY
    and END macros for assembly implementation or do some C preprocessor magic if
    the new file is coded in C.  The idea is to include it but changing the symbol
    name to __memcmp_e6500.
 3. Finally add the new implementation at sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
    so the testsuite can select it for testcases.

Post the patch on libc-alpha along with benchsuite results for the machine.  Also
if the patch does not use any non-ISA specific instructions you may consider 
adding this optimization as a default ISA one (for instance, if it uses altivec
and is compatible with ISA 2.05 you may enabled it for POWER5+). 

On 22-07-2015 07:25, Dharmakan Rohit Arul Raj wrote:
> Hello All,
> 
> I have added an optimized PowerPC e6500 library (memcmp) to glibc v2.20 sources and I need some clarification regarding multi-arch support.
> The patch works if configured with --disable-multi-arch. But for default build, since multi-arch support is enabled by default, I get this error.
> 
> eglibc/opt/freescale/XLMe6500-test/obj_glibc_1_scratch/libc_pic.a(memcmp-ppc64.os):(.opd+0x0): multiple definition of `__GI_memcmp'
> eglibc/opt/freescale/XLMe6500-test/obj_glibc_1_scratch/libc_pic.a(memcmp.os):(.opd+0x0): first defined here
> 
> As of now, we don't have any intention to add multi-arch support, so wanted to know the criteria to submit this patch to FSF. 
> Can I add this flag [--disable-multi-arch] by default for our target or should I try to resolve these multiple definition errors?
> 
> Please let me know your comments.
> 
> Regards,
> Rohit
> 
> 
> 
> 


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