[llvm-bugs] [Bug 48223] New: [AVX512][Regression] Failed to use vpsubusw

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 18 16:16:02 PST 2020


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

            Bug ID: 48223
           Summary: [AVX512][Regression] Failed to use vpsubusw
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, pengfei.wang at intel.com,
                    spatel+llvm at rotateright.com

#define SIZE 32
#define WSIZE 64
unsigned short head[SIZE] __attribute__((aligned(64)));

void f(void)
{
  for (unsigned n = 0; n < SIZE; ++n) {
    unsigned short m = head[n];
    head[n] = (unsigned short)(m >= WSIZE ? m-WSIZE : 0);
  }
}

Clang 11 or newer with -O3 -mavx512f:

f():                                  # @f()
        vmovdqa ymm0, ymmword ptr [rip + .LCPI0_0] # ymm0 =
[64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64]
        vmovdqa ymm1, ymmword ptr [rip + head+32]
        vpmaxuw ymm2, ymm1, ymm0
        vpcmpeqw        ymm2, ymm1, ymm2
        vmovdqa ymm3, ymmword ptr [rip + head]
        vpmaxuw ymm0, ymm3, ymm0
        vpcmpeqw        ymm0, ymm3, ymm0
        vinserti64x4    zmm0, zmm0, ymm2, 1
        vmovdqa ymm2, ymmword ptr [rip + .LCPI0_1] # ymm2 =
[65472,65472,65472,65472,65472,65472,65472,65472,65472,65472,65472,65472,65472,65472,65472,65472]
        vpaddw  ymm1, ymm1, ymm2
        vpaddw  ymm2, ymm3, ymm2
        vinserti64x4    zmm1, zmm2, ymm1, 1
        vpandq  zmm0, zmm0, zmm1
        vmovdqa64       zmmword ptr [rip + head], zmm0
        vzeroupper
        ret

Clang 10 or ICC -O3 -mavx512f:
f():                                  # @f()
        vmovdqa ymm0, ymmword ptr [rip + head]
        vmovdqa ymm1, ymmword ptr [rip + head+32]
        vmovdqa ymm2, ymmword ptr [rip + .LCPI0_0] # ymm2 =
[64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64]
        vpsubusw        ymm1, ymm1, ymm2
        vpsubusw        ymm0, ymm0, ymm2
        vmovdqa ymmword ptr [rip + head], ymm0
        vmovdqa ymmword ptr [rip + head+32], ymm1
        vzeroupper
        ret

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201119/5e2850ea/attachment.html>


More information about the llvm-bugs mailing list