[llvm-bugs] [Bug 38949] New: [X86][AVX] vbroadcastf128 not always used

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 14 07:01:47 PDT 2018


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

            Bug ID: 38949
           Summary: [X86][AVX] vbroadcastf128 not always used
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    spatel+llvm at rotateright.com

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

Under all but the simplest circumstances we don't lower to vbroadcastf128 when
we could.

__m256 test0(float *a) {
    __m256 v = _mm256_broadcast_ps((__m128 const*)a);
    return v;
}

test0:
  vbroadcastf128 (%rdi), %ymm0 # ymm0 = mem[0,1,0,1]
  retq

void test1(float *a) {
    __m256 v = _mm256_broadcast_ps((__m128 const*)a);
    *((__m256*)a) = v;
}

test1:
  vmovups (%rdi), %xmm0
  vinsertf128 $1, %xmm0, %ymm0, %ymm0
  vmovaps %ymm0, (%rdi)
  retq

-- 
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/20180914/daa2dc06/attachment-0001.html>


More information about the llvm-bugs mailing list