diff --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst --- a/clang/docs/LanguageExtensions.rst +++ b/clang/docs/LanguageExtensions.rst @@ -526,6 +526,7 @@ * 64-bit ARM (AArch64) * AMDGPU * SPIR +* RISC-V ``_Float16`` will be supported on more targets as they define ABIs for it. @@ -535,13 +536,18 @@ The ``__bf16`` type is only available when supported in hardware. -``__fp16`` is a storage and interchange format only. This means that values of +``__fp16`` is a storage and interchange format only on most targets. This means that values of ``__fp16`` are immediately promoted to (at least) ``float`` when used in arithmetic operations, so that e.g. the result of adding two ``__fp16`` values has type ``float``. The behavior of ``__fp16`` is specified by the ARM C Language Extensions (`ACLE `_). Clang uses the ``binary16`` format from IEEE 754-2008 for ``__fp16``, not the ARM alternative format. +On RISC-V, the evaluation format of ``__fp16`` will depend on the presence of +the ``Zfh`` (half-precision) extension. ``__fp16`` will perform arithmetic +without promotion when the Zfh extension is enabled, and promoted to float +otherwise. + ``_Float16`` is an interchange floating-point type. This means that, just like arithmetic on ``float`` or ``double``, arithmetic on ``_Float16`` operands is formally performed in the ``_Float16`` type, so that e.g. the result of adding two ``_Float16`` values has type