[llvm-bugs] [Bug 46899] New: avx512 - codegen regression

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 29 13:13:35 PDT 2020


            Bug ID: 46899
           Summary: avx512 - codegen regression
           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, spatel+llvm at rotateright.com

typedef unsigned char uint8_t;

static inline uint8_t x264_clip_uint8( int x )
  return x&(~63) ? (-x)>>7 : x;

void mc_weight( uint8_t *__restrict dst, uint8_t *__restrict src)
        for( int x = 0; x < 16; x++ )
            dst[x] = x264_clip_uint8(src[x]);

Clang 9 -Ofast -march=skylake-avx512

mc_weight(unsigned char*, unsigned char*):    
        vmovdqu xmm0, xmmword ptr [rsi]
        vpmovzxbd       zmm1, xmm0
        vpcmpnleub      k1, xmm0, xmmword ptr [rip + .LCPI0_0]
        vpxor   xmm0, xmm0, xmm0
        vpsubd  zmm0, zmm0, zmm1
        vpsrld  zmm1 {k1}, zmm0, 7
        vpmovdb xmmword ptr [rdi], zmm1

Clang trunk -Ofast -march=skylake-avx512

mc_weight(unsigned char*, unsigned char*):  
        vmovdqu xmm0, xmmword ptr [rsi]
        vpbroadcastq    xmm1, qword ptr [rsi + 8]
        vpmovzxbd       ymm1, xmm1 
        vpcmpltub       k1, xmm0, xmmword ptr [rip + .LCPI0_0]
        vpxor   xmm2, xmm2, xmm2
        vpsubd  ymm3, ymm2, ymm1
        vpsrld  ymm3, ymm3, 7
        kshiftrw        k2, k1, 8
        vmovdqa32       ymm3 {k2}, ymm1
        vpmovzxbd       ymm0, xmm0       
        vpsubd  ymm1, ymm2, ymm0
        vpsrld  ymm1, ymm1, 7
        vpmovdb xmm2, ymm3
        vmovdqa32       ymm1 {k1}, ymm0
        vpmovdb xmm0, ymm1
        vpunpcklqdq     xmm0, xmm0, xmm2 
        vmovdqu xmmword ptr [rdi], xmm0

Godbolt: https://godbolt.org/z/P4bWYb

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/20200729/b37f19bc/attachment.html>

More information about the llvm-bugs mailing list