[cfe-dev] [RFC] implementation of _Float16

Sjoerd Meijer via cfe-dev cfe-dev at lists.llvm.org
Wed May 10 03:18:56 PDT 2017


Hi,

ARMv8.2-A introduces as an optional extension half-precision data-processing instructions for Advanced SIMD and floating-point in both AArch64 and AArch32 states [1], and we are looking into implementing C/C++-language support for these new ARMv8.2-A half-precision instructions.

We would like to introduce a new Clang type. The reason is that we e.g. cannot use type __fp16 (defined in the ARM C Language Extensions [2]) because it is a storage type only. This means when using standard C operators values of __fp16 type promote to float when used in arithmetic operations, which we would like to avoid for the ARMv8.2-A half-precision instructions. Please note that the LLVM IR already has a half precision type, onto which for example __fp16 is mapped, so there are no changes or additions required for the LLVM IR.

As a new Clang type we would like to propose _Float16 as defined in a C11 extension, see [3]. Arithmetic is well defined, it is not only a storage type as __fp16. Our question is whether a partial implementation, just implementing this type and not claiming (full) C11 conformance is acceptable?

[1] ARM ARM: https://static.docs.arm.com/ddi0487/b/DDI0487B_a_armv8_arm.pdf
[2] ARM C Language Extensions 2.1: http://infocenter.arm.com/help/topic/com.arm.doc.ihi0053d/IHI0053D_acle_2_1.pdf
[3] ISO/IEC TS 18661-3  interchange and extended types:  http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1945.pdf

Cheers,
Sjoerd.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170510/bdce1524/attachment.html>


More information about the cfe-dev mailing list