https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96891

            Bug ID: 96891
           Summary: [AVX512] For vector compare to dest vector, avx512
                    vector compare could be lowered to avx version
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: crazylht at gmail dot com
  Target Milestone: ---
            Target: x86_64-*-* i?86-*-*

cat test.cpp

---
typedef float v8sf __attribute__ ((vector_size (32)));
v8sf test4(v8sf a, v8sf b)
{
    return a >= b;
}
---

gcc -O2 -mavx512f -mavx512vl -S 

---
test4:
        vcmpps  k1, ymm1, ymm0, 2
        vpternlogd      ymm0{k1}{z}, ymm0, ymm0, 0x81
        ret
---

gcc -O2 -mavx

---
test4:
        vcmpleps        ymm0, ymm1, ymm0
        ret
---

Add peephole 2 handle this?

Reply via email to