[cfe-dev] _Float16 support (Kaylor, Andrew via cfe-dev)

Jon Chesterfield via cfe-dev cfe-dev at lists.llvm.org
Wed Jan 23 02:00:48 PST 2019


>
> I haven't looked at what happens with clang when compiling for other
> targets that don't have native support for half-precision arithmetic, but I
> would imagine that similar problems exist.
>

As a comparison point, our out of tree target uses __fp16 (and will move to
_Float16 once I find time to work out what semantic changes that causes)
but doesn't have native support for it.

In order to avoid spuriously converting to/from f32 across function calls
it's special cased in the calling convention. Essentially pass in the low
half of a f32 register without changing the bit pattern. This has no
drawbacks known to me.

Cheers,

Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190123/7f72c285/attachment.html>


More information about the cfe-dev mailing list