public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug string/18880] New: Wrong selector in x86_64/multiarch/memcpy.S
@ 2015-08-28 11:46 hjl.tools at gmail dot com
  2015-08-28 12:01 ` [Bug string/18880] " hjl.tools at gmail dot com
  2015-08-28 13:06 ` cvs-commit at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: hjl.tools at gmail dot com @ 2015-08-28 11:46 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=18880

            Bug ID: 18880
           Summary: Wrong selector in x86_64/multiarch/memcpy.S
           Product: glibc
           Version: 2.23
            Status: NEW
          Severity: normal
          Priority: P2
         Component: string
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
  Target Milestone: ---

x86_64/multiarch/memcpy.S has

ENTRY(__new_memcpy)
        .type   __new_memcpy, @gnu_indirect_function
        LOAD_RTLD_GLOBAL_RO_RDX
        leaq    __memcpy_avx_unaligned(%rip), %rax
        HAS_ARCH_FEATURE (AVX_Fast_Unaligned_Load)
        jz 1f
        ret
1:      leaq    __memcpy_sse2(%rip), %rax
        HAS_ARCH_FEATURE (Slow_BSF)
        jnz     2f
        leaq    __memcpy_sse2_unaligned(%rip), %rax
        ret
2:      HAS_CPU_FEATURE (SSSE3)
        jz 3f
        leaq    __memcpy_ssse3(%rip), %rax
3:      ret
END(__new_memcpy)

But Slow_BSF feature has nothing to do with any memcpy implementations.
It should be

ENTRY(__new_memcpy)
        .type   __new_memcpy, @gnu_indirect_function
        LOAD_RTLD_GLOBAL_RO_RDX
        leaq    __memcpy_avx_unaligned(%rip), %rax
        HAS_ARCH_FEATURE (AVX_Fast_Unaligned_Load)
        jz 1f
        ret
1:      leaq    __memcpy_sse2_unaligned(%rip), %rax
        HAS_ARCH_FEATURE (Fast_Unaligned_Load)
        jz      2f
        ret
2:      leaq    __memcpy_sse2(%rip), %rax
        HAS_CPU_FEATURE (SSSE3)
        jz 3f
        leaq    __memcpy_ssse3(%rip), %rax
3:      ret
END(__new_memcpy)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug string/18880] Wrong selector in x86_64/multiarch/memcpy.S
  2015-08-28 11:46 [Bug string/18880] New: Wrong selector in x86_64/multiarch/memcpy.S hjl.tools at gmail dot com
@ 2015-08-28 12:01 ` hjl.tools at gmail dot com
  2015-08-28 13:06 ` cvs-commit at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: hjl.tools at gmail dot com @ 2015-08-28 12:01 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=18880

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
Also __memcpy_ssse3_back isn't used.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug string/18880] Wrong selector in x86_64/multiarch/memcpy.S
  2015-08-28 11:46 [Bug string/18880] New: Wrong selector in x86_64/multiarch/memcpy.S hjl.tools at gmail dot com
  2015-08-28 12:01 ` [Bug string/18880] " hjl.tools at gmail dot com
@ 2015-08-28 13:06 ` cvs-commit at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-08-28 13:06 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=18880

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/unaligned has been created
        at  9db00f75ae25af0c043de52786739dcdf52e53f5 (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9db00f75ae25af0c043de52786739dcdf52e53f5

commit 9db00f75ae25af0c043de52786739dcdf52e53f5
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Aug 25 11:01:20 2015 -0700

    Make strcmp with unaligned load/store the default

    Since strcmp_sse2_unaligned performs better on current Intel and AMD
    processors, this patch makes it the default.

        * sysdeps/x86_64/strcmp.S: Moved to ...
        * sysdeps/x86_64/multiarch/strcmp-sse2.S:  Here.  Remove
        "#if !IS_IN (libc)".  Remove libc_hidden_builtin_def (STRCMP).
        (STRCMP): Defined to __strcmp_sse2 if not defined.
        * sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S: Moved to ...
        * sysdeps/x86_64/strcmp.S: Here.  Remove "#if IS_IN (libc)".
        Add .text.  Add libc_hidden_builtin_def (strcmp).
        (__strcmp_sse2_unaligned): Renamed to ...
        (strcmp): This.
        * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Add
        strcmp-sse2.
        * sysdeps/x86_64/multiarch/strcasecmp_l-ssse3.S: Include
        strcmp-sse2.S instead of ../strcmp.S.
        * sysdeps/x86_64/multiarch/strcmp-ssse3.S: Likewise.
        * sysdeps/x86_64/multiarch/strncase_l-ssse3.S: Likewise.
        * sysdeps/x86_64/multiarch/strncmp-ssse3.S: Likewise.
        * sysdeps/x86_64/multiarch/strcmp.S
        [USE_AS_STRCMP] (STRCMP_SSE2): Set to __strcmp_sse2_unaligned.
        [USE_AS_STRCMP] (STRCMP): Load __strcmp_sse2 instead of
        STRCMP_SSE2.
        [USE_AS_STRCMP] (strcmp): Defined __strcmp_sse2_unaligned if
        in libc.
        [!USE_AS_STRCMP]: Include strcmp-sse2S instead of ../strcmp.S.
        * sysdeps/x86_64/strcasecmp_l.S: Include multiarch/strcmp-sse2.S
        instead of strcmp.S.  Add libc_hidden_builtin_def (STRCMP).
        * sysdeps/x86_64/strncase_l.S: Likewise.
        * sysdeps/x86_64/strncmp.S: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e05a252da92a4dd15d4be40a855d31bd864804e9

commit e05a252da92a4dd15d4be40a855d31bd864804e9
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Aug 28 05:40:35 2015 -0700

    Correct x86-64 memcpy/mempcpy multiarch selector

    For x86-64 memcpy/mempcpy, we choose the best implementation by the
    order:

    1. __memcpy_avx_unaligned if AVX_Fast_Unaligned_Load bit is set.
    2. __memcpy_sse2_unaligned if Fast_Unaligned_Load bit is set.
    3. __memcpy_sse2 if SSSE3 isn't available.
    4. __memcpy_ssse3_back if Fast_Copy_Backward bit it set.
    5. __memcpy_ssse3

    In libc.a and ld.so, we choose __memcpy_sse2_unaligned which is optimized
    for current Intel and AMD x86-64 processors.

        [BZ #18880]
        * sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: Moved to ...
        * sysdeps/x86_64/memcpy.S: Here.  Remove "#if !IS_IN (libc)".
        Add libc_hidden_builtin_def and versioned_symbol.
        (__memcpy_chk): New.
        (__memcpy_sse2_unaligned): Renamed to ...
        (memcpy): This.  Support USE_AS_MEMPCPY.
        * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Add
        mempcpy-sse2.
        * sysdeps/x86_64/memcpy.S: Moved to ...
        sysdeps/x86_64/multiarch/memcpy-sse2.S: Here.
        (__memcpy_chk): Renamed to ...
        (__memcpy_chk_sse2): This.
        (memcpy): Renamed to ...
        (__memcpy_sse2): This.
        * sysdeps/x86_64/multiarch/memcpy.S (__new_memcpy): Properly
        select the best implementation.
        (ENTRY): Replace __memcpy_sse2 with __memcpy_sse2_unaligned.
        (END): Likewise.
        (libc_hidden_builtin_def): Likewise.
        (ENTRY_CHK): Replace __memcpy_chk_sse2 with
        __memcpy_chk_sse2_unaligned.
        (END_CHK): Likewise.
        * sysdeps/x86_64/multiarch/memcpy_chk.S (__memcpy_chk): Properly
        select the best implementation.
        * sysdeps/x86_64/multiarch/mempcpy.S (__mempcpy): Properly
        select the best implementation.
        (ENTRY): Replace __mempcpy_sse2 with __mempcpy_sse2_unaligned.
        (END): Likewise.
        (libc_hidden_def): Likewise.
        (libc_hidden_builtin_def): Likewise.
        (ENTRY_CHK): Replace __mempcpy_chk_sse2 with
        __mempcpy_chk_sse2_unaligned.
        (END_CHK): Likewise.
        * sysdeps/x86_64/multiarch/mempcpy_chk.S (__mempcpy_chk): Properly
        select the best implementation.

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-28 13:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-28 11:46 [Bug string/18880] New: Wrong selector in x86_64/multiarch/memcpy.S hjl.tools at gmail dot com
2015-08-28 12:01 ` [Bug string/18880] " hjl.tools at gmail dot com
2015-08-28 13:06 ` cvs-commit at gcc dot gnu.org

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).