[Bug target/104610] memcmp () == 0 can be optimized better for avx512f

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Feb 21 11:01:20 GMT 2022


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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note even without avx512f, LLVM does:

        movdqu  (%rdi), %xmm0
        movdqu  16(%rdi), %xmm1
        pcmpeqb .LCPI0_0(%rip), %xmm1
        pcmpeqb .LCPI0_1(%rip), %xmm0
        pand    %xmm1, %xmm0
        pmovmskb        %xmm0, %eax
        cmpl    $65535, %eax                    # imm = 0xFFFF
        sete    %al


More information about the Gcc-bugs mailing list