This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/54700] Optimize away x<0 as mask argument of a blend.
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 03 Apr 2016 15:22:17 +0000
- Subject: [Bug target/54700] Optimize away x<0 as mask argument of a blend.
- Auto-submitted: auto-generated
- References: <bug-54700-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54700
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
This was missing a simple testcase, but now we can write one (in C++):
typedef int vec __attribute__((vector_size(32)));
vec f(vec x){
return x<0?2:1;
}
vpxor %xmm1, %xmm1, %xmm1
vpcmpgtd %ymm0, %ymm1, %ymm1
vmovdqa .LC1(%rip), %ymm0
vpblendvb %ymm1, .LC0(%rip), %ymm0, %ymm0
IIUC, we could skip vpcmpgtd and pass ymm0 directly to vpblendvb.