https://bugs.llvm.org/show_bug.cgi?id=42653

            Bug ID: 42653
           Summary: [X86][AVX] Rematerializable lower 'allones' subvector
                    masks
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedb...@nondot.org
          Reporter: llvm-...@redking.me.uk
                CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
                    llvm-...@redking.me.uk, spatel+l...@rotateright.com

https://gcc.godbolt.org/z/ESwT78

We should be able to rematerialize masks where the lower subvector half is -1
and the upper 0 by using a smaller destination and the implicit zeroing of the
upper bits:

#include <x86intrin.h>

__m128i low128_128() {
    // GOOD
    return _mm_setr_epi32(-1,-1,-1,-1);
}
__m256i low256_128() {
    // BAD: vpcmpeqd %xmm0, %xmm0, %xmm0
    return _mm256_setr_epi32(-1,-1,-1,-1,0,0,0,0);
}
__m512i low512_128() {
    // BAD: vpcmpeqd %xmm0, %xmm0, %xmm0
    return _mm512_setr_epi32(-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0);
}
__m512i low512_256() {
    // BAD: vpcmpeqd %ymm0, %ymm0, %ymm0
    return _mm512_setr_epi32(-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0);
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to