[llvm-bugs] [Bug 42607] New: Missed opportunity for vpadd

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 12 12:07:20 PDT 2019


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

            Bug ID: 42607
           Summary: Missed opportunity for vpadd
           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 long long v64u64 __attribute__((vector_size(64)));
typedef unsigned __int128 v64u128 __attribute__((vector_size(64)));

v64u64 foo(v64u64 a, v64u128 b) { return a + (v64u64)b; }

-O3 -mavx512vbmi -march=skylake

Clang:
foo:                                    # @foo
        vmovq   xmm1, rcx
        vmovq   xmm2, rdx
        vpunpcklqdq     xmm1, xmm2, xmm1 # xmm1 = xmm2[0],xmm1[0]
        vmovq   xmm2, rsi
        vmovq   xmm3, rdi
        vpunpcklqdq     xmm2, xmm3, xmm2 # xmm2 = xmm3[0],xmm2[0]
        vinserti128     ymm1, ymm2, xmm1, 1
        vmovq   xmm2, r9
        vmovq   xmm3, r8
        vpunpcklqdq     xmm2, xmm3, xmm2 # xmm2 = xmm3[0],xmm2[0]
        vinserti128     ymm2, ymm2, xmmword ptr [rsp + 8], 1
        vinserti64x4    zmm1, zmm1, ymm2, 1
        vpaddq  zmm0, zmm1, zmm0
        ret

GCC:
foo:
        vpaddq  zmm0, zmm0, ZMMWORD PTR [rsp+8]
        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/20190712/b66e6530/attachment.html>


More information about the llvm-bugs mailing list