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

--- Comment #12 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Hongtao.liu from comment #10)

> Sure.
Please find attached the complete patch that enables HF vector modes in Comment
#11. The patch survives bootstrap and regression test and works OK for the
following testcase:

--cut here--
typedef _Float16 vf64 __attribute__((vector_size(64)));
typedef _Float16 vf32 __attribute__((vector_size(32)));
typedef _Float16 vf16 __attribute__((vector_size(16)));

#ifdef __AVX512F__
vf64 bar64 (_Float16 a)
{
  return (vf64) { a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a,
a, a, a, a, a, a, a, a, a, a, a, a };
}
#endif

#ifdef __AVX__
vf32 bar32 (_Float16 a)
{
  return (vf32) { a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a };
}
#endif

#ifdef __SSE2__
vf16 baz16 (_Float16 a)
{
  return (vf16) { a, a, a, a, a, a, a, a };
}
#endif
--cut here--

for -msse2, -mavx, -mavx512f and -mavx512bw.

Perhaps some VxHF patterns need to be re-enabled for lower ABIs, but the
generic target code auto-detects them. Now the generic target code does not
assume that vector HF modes depend solely on TARGET_AVX512FP16.

Hongtao, can you please review the patch and perhaps test it a bit more?

Reply via email to