This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Build and test memory functions in glibc-2.25
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-help at sourceware dot org
- Date: Mon, 27 Mar 2017 14:29:07 -0300
- Subject: Re: Build and test memory functions in glibc-2.25
- Authentication-results: sourceware.org; auth=none
- References: <A5E93B907A3D7B45A6901D155C285E921276A2E5@EXMBX-TJ003.tencent.com> <DDC0A53C62D26D419EFD5F13B1AD3EA5A6C280F4@ORSMSX103.amr.corp.intel.com>
On 27/03/2017 13:01, Lu, Hongjiu wrote:
> Hi hongjiu and glibc developers,
>
> I was investigating whether a few memory functions(memcpy, memset, memmove) with various versions(sse4, ssse3, avx2, avx512) in glibc-2.25 could have performance gain for our server programs in Linux(glibc 2.12). I put the detailed question on stackoverflow(http://stackoverflow.com/questions/42999511/port-glibc-2-25-and-test-memory-functions). In short, my questions are as follows:
>
> 1. I built glibc-2.25 on my dev machine and run my application under newly built glibc. Then did the glibc select the most suitable version of memory functions automatically for me according to the cpu/os/memory?
>
> That is correct.
>
> H.J.
> ----
> 2. If #1’s answer is no, do I need to tweak a few options for ./configuration and make to achieve that?
Default configure option for x86_64 is to enable ifunc (or multi-arch in glibc terminology)
as default. So, unless you actually configured glibc with --disable-multi-arch you will
have ifunc enabled.
>
> 3. If #2 is impossible, I was wondering if I need to dispatch the memcpy/memset/memmove calls to the appropriate version of functions with __attribute__((ifunc))( https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40528 ) manually according to the corresponding boolean test of the cpu(Built-in Function: int __builtin_cpu_supports (const char *feature))?
>
> I reviewed changelog and the related links above and put hongjiu on the list explicitly. Please help take a look and I’m looking forward to your replies.
>
> Thanks in advance.
>
> ________________________________________
> wentingli(李文亭)
>