[llvm-bugs] [Bug 45015] New: [X86][AVX] Failure to generate vaddsubps for pattern after 19b62b79
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Feb 24 23:47:53 PST 2020
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: unassignedbugs at nondot.org
Reporter: douglas_yung at playstation.sony.com
CC: htmldeveloper at gmail.com, llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200225/3b7ecc7d/attachment.html>
More information about the llvm-bugs
mailing list