@@ -784,8 +784,8 @@ supported if the compiler can emulate arithmetic on the type by promoting
784
784
to ``float ``; see below for more information on this emulation.
785
785
786
786
* ``__fp16 `` is supported on all targets. The special semantics of this
787
- type mean that no arithmetic is ever performed directly on ``__fp16 `` values;
788
- see below.
787
+ type mean that no arithmetic is ever performed directly on ``__fp16 `` values;
788
+ see below.
789
789
790
790
* ``_Float16 `` is supported on the following targets:
791
791
* 32-bit ARM (natively on some architecture versions)
@@ -809,7 +809,7 @@ which provides an 8-bit exponent and an 8-bit significand; this is the same
809
809
exponent range as `float `, just with greatly reduced precision.
810
810
811
811
``_Float16 `` and ``__bf16 `` follow the usual rules for arithmetic
812
- floating-point types. Most importantly, this means that arithmetic operations
812
+ floating-point types. Most importantly, this means that arithmetic operations
813
813
on operands of these types are formally performed in the type and produce
814
814
values of the type. ``__fp16 `` does not follow those rules: most operations
815
815
immediately promote operands of type ``__fp16 `` to ``float ``, and so
@@ -833,28 +833,29 @@ the C++ standard.
833
833
834
834
The use of excess precision can be independently controlled for these two
835
835
types with the ``-ffloat16-excess-precision= `` and
836
- ``-fbfloat16-excess-precision= `` options. Valid values include:
837
- - ``none `` (meaning to perform strict operation-by-operation emulation)
838
- - ``standard `` (meaning that excess precision is permitted under the rules
839
- described in the standard, i.e. never across explicit casts or statements)
840
- - ``fast `` (meaning that excess precision is permitted whenever the
836
+ ``-fbfloat16-excess-precision= `` options. Valid values include:
837
+
838
+ * ``none ``: meaning to perform strict operation-by-operation emulation
839
+ * ``standard ``: meaning that excess precision is permitted under the rules
840
+ described in the standard, i.e. never across explicit casts or statements
841
+ * ``fast ``: meaning that excess precision is permitted whenever the
841
842
optimizer sees an opportunity to avoid truncations; currently this has no
842
- effect beyond ``standard ``)
843
+ effect beyond ``standard ``
843
844
844
845
The ``_Float16 `` type is an interchange floating type specified in
845
- ISO/IEC TS 18661-3:2015 ("Floating-point extensions for C"). It will
846
+ ISO/IEC TS 18661-3:2015 ("Floating-point extensions for C"). It will
846
847
be supported on more targets as they define ABIs for it.
847
848
848
849
The ``__bf16 `` type is a non-standard extension, but it generally follows
849
850
the rules for arithmetic interchange floating types from ISO/IEC TS
850
- 18661-3:2015. In previous versions of Clang, it was a storage-only type
851
- that forbade arithmetic operations. It will be supported on more targets
851
+ 18661-3:2015. In previous versions of Clang, it was a storage-only type
852
+ that forbade arithmetic operations. It will be supported on more targets
852
853
as they define ABIs for it.
853
854
854
855
The ``__fp16 `` type was originally an ARM extension and is specified
855
856
by the `ARM C Language Extensions <https://github.com/ARM-software/acle/releases >`_.
856
857
Clang uses the ``binary16 `` format from IEEE 754-2008 for ``__fp16 ``,
857
- not the ARM alternative format. Operators that expect arithmetic operands
858
+ not the ARM alternative format. Operators that expect arithmetic operands
858
859
immediately promote ``__fp16 `` operands to ``float ``.
859
860
860
861
It is recommended that portable code use ``_Float16 `` instead of ``__fp16 ``,
@@ -870,7 +871,7 @@ A literal can be given ``_Float16`` type using the suffix ``f16``. For example,
870
871
871
872
Because default argument promotion only applies to the standard floating-point
872
873
types, ``_Float16 `` values are not promoted to ``double `` when passed as variadic
873
- or untyped arguments. As a consequence, some caution must be taken when using
874
+ or untyped arguments. As a consequence, some caution must be taken when using
874
875
certain library facilities with ``_Float16 ``; for example, there is no ``printf `` format
875
876
specifier for ``_Float16 ``, and (unlike ``float ``) it will not be implicitly promoted to
876
877
``double `` when passed to ``printf ``, so the programmer must explicitly cast it to
0 commit comments