x86_64: memcpy/memmove family optimized with AVX512
diff mbox

Message ID CALoOobNaJPPr_Bq+CSec1uB5kGZ282o6UgohT4D46sUc-CLBuA@mail.gmail.com
State New
Headers show

Commit Message

Paul Pluzhnikov Jan. 18, 2016, 10:56 p.m. UTC
On Mon, Jan 18, 2016 at 2:29 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Mon, Jan 18, 2016 at 10:50 AM, Paul Pluzhnikov
> <ppluzhnikov@google.com> wrote:
>> This patch appears to break my build:
>>

> Please try this.


@@ -309,8 +317,10 @@ __libc_ifunc_impl_list (const char *name, struct
libc_ifunc_impl *array,
   /* Support sysdeps/x86_64/multiarch/mempcpy.S.  */
   IFUNC_IMPL (i, name, mempcpy,
       IFUNC_IMPL_ADD (array, i, mempcpy,
+# ifdef HAVE_AVX512_ASM_SUPPORT
       HAS_ARCH_FEATURE (AVX512F_Usable),
       __mempcpy_avx512_no_vzeroupper)
+# endif
       IFUNC_IMPL_ADD (array, i, mempcpy,
       HAS_ARCH_FEATURE (AVX_Usable),
       __mempcpy_avx_unaligned)

Likewise.

You also missed __memmove_avx512_no_vzeroupper.

Attached patch makes it build and pass tests for me.

Thanks,

Comments

Andrew Senkevich Jan. 19, 2016, 11:52 a.m. UTC | #1
2016-01-19 1:56 GMT+03:00 Paul Pluzhnikov <ppluzhnikov@google.com>:
> On Mon, Jan 18, 2016 at 2:29 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Mon, Jan 18, 2016 at 10:50 AM, Paul Pluzhnikov
>> <ppluzhnikov@google.com> wrote:
>>> This patch appears to break my build:
>>>
>
>> Please try this.
>
> --- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
> +++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
> @@ -49,8 +49,10 @@ __libc_ifunc_impl_list (const char *name, struct
> libc_ifunc_impl *array,
>    /* Support sysdeps/x86_64/multiarch/memmove_chk.c.  */
>    IFUNC_IMPL (i, name, __memmove_chk,
>        IFUNC_IMPL_ADD (array, i, __memmove_chk,
> +#ifdef HAVE_AVX512_ASM_SUPPORT
>        HAS_ARCH_FEATURE (AVX512F_Usable),
>        __memmove_chk_avx512_no_vzeroupper)
> +#endif
>
> The #ifdef should be moved one line up, I think.
>
> @@ -309,8 +317,10 @@ __libc_ifunc_impl_list (const char *name, struct
> libc_ifunc_impl *array,
>    /* Support sysdeps/x86_64/multiarch/mempcpy.S.  */
>    IFUNC_IMPL (i, name, mempcpy,
>        IFUNC_IMPL_ADD (array, i, mempcpy,
> +# ifdef HAVE_AVX512_ASM_SUPPORT
>        HAS_ARCH_FEATURE (AVX512F_Usable),
>        __mempcpy_avx512_no_vzeroupper)
> +# endif
>        IFUNC_IMPL_ADD (array, i, mempcpy,
>        HAS_ARCH_FEATURE (AVX_Usable),
>        __mempcpy_avx_unaligned)
>
> Likewise.
>
> You also missed __memmove_avx512_no_vzeroupper.
>
> Attached patch makes it build and pass tests for me.

Yes, it was done for memset but forgotten here. Thanks, fixed.


--
WBR,
Andrew

Patch
diff mbox

--- a/sysdeps/x86_64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/x86_64/multiarch/ifunc-impl-list.c
@@ -49,8 +49,10 @@  __libc_ifunc_impl_list (const char *name, struct
libc_ifunc_impl *array,
   /* Support sysdeps/x86_64/multiarch/memmove_chk.c.  */
   IFUNC_IMPL (i, name, __memmove_chk,
       IFUNC_IMPL_ADD (array, i, __memmove_chk,
+#ifdef HAVE_AVX512_ASM_SUPPORT
       HAS_ARCH_FEATURE (AVX512F_Usable),
       __memmove_chk_avx512_no_vzeroupper)
+#endif

The #ifdef should be moved one line up, I think.