This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/54700] Optimize away x<0 as mask argument of a blend.


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]