_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Hi Jason,
__fp16 is a pure storage format. You cannot pass it by value, because only ABI permissive types can be passed by value while __fp16 is not one of them.
half as a target independent type is legal for LLVM. It’s not legal for unsupported target like X86. The behavior depends on how we lowering it. But I don’t know why there’s differences between Linux and Windows. Maybe because “__gnu_f2h_ieee” is a Linux only function?
Thanks
Pengfei
__fp16 is a pure storage format. You cannot pass it by value, because only ABI permissive types can be passed by value while __fp16 is not one of them.
I guess it’s designed for language portability. You can use this type across different platforms. Nevertheless, I’m not a FE expert, so I cannot think out other intentions.
The _Float16 is a primitive type in the latest x86 ABI, but there’s no X86 target that supports it yet. So you cannot use it on X86 by now. I think that’s the difference from __fp16 and why should use it.
We also have some discussion here. https://reviews.llvm.org/D97318
Thanks
Pengfei
Hi Jason,
The different behavior between Linux and Windows comes form the difference of the calling conversion. Windows uses 4 registers for arguments passing which Linux uses 6.
https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention?view=msvc-160#parameter-passing