[llvm-bugs] [Bug 26667] New: [Regression] Wrong codegen for AVX permute intrinsic

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Feb 18 10:40:18 PST 2016


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

            Bug ID: 26667
           Summary: [Regression] Wrong codegen for AVX permute intrinsic
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: Yunzhong_Gao at playstation.sony.com
                CC: llvm-bugs at lists.llvm.org, llvm-dev at redking.me.uk
    Classification: Unclassified

// test.c
typedef double __m256d __attribute__((__vector_size__(32)));
typedef double __v4df __attribute__ ((__vector_size__ (32)));
#define _mm256_permute2f128_pd(V1, V2, M) \
  (__m256d)__builtin_ia32_vperm2f128_pd256((__v4df)(V1), (__v4df)(V2), (M))

__m256d foo(__m256d Lhs, __m256d Rhs) {
  return _mm256_permute2f128_pd(Lhs, Rhs, 50);
}
// end test.c

$ clang -O0 -S -mavx test.c -o -

Here is the assembly sequence produced by r260062:
    andq    $-32, %rsp
    subq    $96, %rsp
    vmovapd    %ymm0, 32(%rsp)
    vmovapd    %ymm1, (%rsp)
    vmovapd    32(%rsp), %ymm0

        # vperm2f128 $src3, $src2, $src1, $dst
        # with mask=$50, $dst = $src2, so in this case, ymm0 <= ymm1
    vperm2f128  $50, %ymm1, %ymm0, %ymm0 # ymm0 = ymm1[0,1,2,3]

And here is the assembly sequence produced by r260063 and later
    andq    $-32, %rsp
    subq    $128, %rsp
    vmovapd    %ymm0, 64(%rsp)
    vmovapd    %ymm1, 32(%rsp)
    vmovapd    64(%rsp), %ymm0
    vmovaps    %ymm1, (%rsp)           # 32-byte Spill
        # and in this case, ymm0 is still ymm0

-- 
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/20160218/afc8d562/attachment.html>


More information about the llvm-bugs mailing list