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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to 罗勇刚(Yonggang Luo) from comment #2)
> (In reply to Jakub Jelinek from comment #1)
> > You are lying to the compiler, don't.  In GCC you can #include <x86intrin.h>
> > with SSE2 only and later in say __attribute__((target ("avx512cd")))
> > function use avx512f/avx512cd intrinsics, no need to do the what you show
> > above.
> 
> Can you be more specific, show me the code, thanks:)

#include <x86intrin.h>

int __attribute__((target("avx512f"))) foo(float f)
{
  __m128 m = _mm_set_ss(f);
  return _mm_cvtss_i32(m);
}

results in (with just SSE2):

foo:
.LFB6614:
        .cfi_startproc
        vcvtss2sil      %xmm0, %eax
        ret

Reply via email to