[Bug target/78102] New: [5/6/7 regression] GCC refuses to generate PCMPEQQ instruction for SSE4.1

vegorov13 at mail dot ru gcc-bugzilla@gcc.gnu.org
Tue Oct 25 02:10:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78102

            Bug ID: 78102
           Summary: [5/6/7 regression] GCC refuses to generate PCMPEQQ
                    instruction for SSE4.1
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vegorov13 at mail dot ru
  Target Milestone: ---

Test case: https://godbolt.org/g/kmycx1

#include <x86intrin.h>

__m128i pcmpeqq(const __m128i x, const __m128i y) {
  return _mm_cmpeq_epi64(x, y);
}

Compiled with -msse4.1. Expected result: PCMPEQQ instruction emitted. However I
get non-vectorised code:

        movaps  XMMWORD PTR [rbp-32], xmm0
        mov     rdx, QWORD PTR [rbp-16]
        mov     rax, QWORD PTR [rbp-32]
        cmp     rdx, rax
        setne   al
        movzx   eax, al
        sub     rax, 1
        mov     QWORD PTR [rbp-72], rax
        movq    xmm0, QWORD PTR [rbp-72]
        mov     rdx, QWORD PTR [rbp-8]
        mov     rax, QWORD PTR [rbp-24]
        cmp     rdx, rax
        setne   al
        movzx   eax, al
        sub     rax, 1
        mov     QWORD PTR [rbp-72], rax
        pinsrq  xmm0, QWORD PTR [rbp-72], 1

If I use -msse4.2 instead, everything works fine. PCMPEQQ is a SSE4.1
instruction though.


More information about the Gcc-bugs mailing list