[Bug target/103571] ABI: V2HF, V4HF and V8HFmode argument passing issues

crazylht at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Dec 9 00:39:05 GMT 2021


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

--- Comment #15 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to Uroš Bizjak from comment #12)
> (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?

Sure.


More information about the Gcc-bugs mailing list