[Bug libc/33542] x86: wmemset ifunc: stray '!' causing SSE2

sam at gentoo dot org sourceware-bugzilla@sourceware.org
Thu Oct 30 13:51:11 GMT 2025


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

Sam James <sam at gentoo dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |2.43

--- Comment #1 from Sam James <sam at gentoo dot org> ---
commit 4d86b6cdd8132e0410347e07262239750f86dfb4
Author:     Jiamei Xie <xiejiamei@hygon.cn>
AuthorDate: Tue Oct 14 20:14:11 2025 +0800
Commit:     Adhemerval Zanella <adhemerval.zanella@linaro.org>
CommitDate: Wed Oct 29 12:54:14 2025 -0300

    x86: fix wmemset ifunc stray '!' (bug 33542)

    The ifunc selector for wmemset had a stray '!' in the
    X86_ISA_CPU_FEATURES_ARCH_P(...) check:

      if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2)
          && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features,
                                          AVX_Fast_Unaligned_Load, !))

    This effectively negated the predicate and caused the AVX2/AVX512
    paths to be skipped, making the dispatcher fall back to the SSE2
    implementation even on CPUs where AVX2/AVX512 are available. The
    regression leads to noticeable throughput loss for wmemset.

    Remove the stray '!' so the AVX_Fast_Unaligned_Load capability is
    tested as intended and the correct AVX2/EVEX variants are selected.

    Impact:
    - On AVX2/AVX512-capable x86_64, wmemset no longer incorrectly
      falls back to SSE2; perf now shows __wmemset_evex/avx2 variants.

    Testing:
    - benchtests/bench-wmemset shows improved bandwidth across sizes.
    - perf confirm the selected symbol is no longer SSE2.

    Signed-off-by: xiejiamei <xiejiamei@hygon.com>
    Signed-off-by: Li jing <lijing@hygon.cn>
    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

Fixed for 2.43. We can backport it (at least to some of the more recent
branches, I don't know if you really want it down to 2.36) if you can test the
branches.

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


More information about the Glibc-bugs mailing list