https://bugs.llvm.org/show_bug.cgi?id=45015
Bug ID: 45015
Summary: [X86][AVX] Failure to generate vaddsubps for pattern
after 19b62b79
Product: new-bugs
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: unassignedb...@nondot.org
Reporter: douglas_y...@playstation.sony.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org
Consider the following code:
#include <x86intrin.h>
__m128 haddsub0ps(__m128 a, __m128 b) {
return (__m128){ a[0] - b[0], a[1] + b[1], a[2] - b[2], a[3] + b[3] };
}
Prior to commit 19b62b79db1bb154b40e8baba9a28ab8aa935b6b, when compiled with
optimizations and avx (-O2 -mavx), the compiler would generate the following
assembly:
vaddsubps %xmm1, %xmm0, %xmm0
But now the compiler is instead generating the following assembly:
vsubss %xmm1, %xmm0, %xmm2
vaddps %xmm1, %xmm0, %xmm3
vblendps $1, %xmm2, %xmm3, %xmm2 # xmm2 = xmm2[0],xmm3[1,2,3]
vsubps %xmm1, %xmm0, %xmm0
vblendps $3, %xmm2, %xmm0, %xmm0 # xmm0 = xmm2[0,1],xmm0[2,3]
vblendps $8, %xmm3, %xmm0, %xmm0 # xmm0 = xmm0[0,1,2],xmm3[3]
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs