Skip to content

Commit dd2e681

Browse files
codemzsphoebewang
authored andcommitted
[Docs] Fix Sphinx documentation formatting issues in LanguageExtensions.rst
Fix indentation and spacing. Reviewed By: pengfei Differential Revision: https://reviews.llvm.org/D151610
1 parent ddeab07 commit dd2e681

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

clang/docs/LanguageExtensions.rst

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,8 @@ supported if the compiler can emulate arithmetic on the type by promoting
784784
to ``float``; see below for more information on this emulation.
785785

786786
* ``__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.
789789

790790
* ``_Float16`` is supported on the following targets:
791791
* 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
809809
exponent range as `float`, just with greatly reduced precision.
810810

811811
``_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
813813
on operands of these types are formally performed in the type and produce
814814
values of the type. ``__fp16`` does not follow those rules: most operations
815815
immediately promote operands of type ``__fp16`` to ``float``, and so
@@ -833,28 +833,29 @@ the C++ standard.
833833

834834
The use of excess precision can be independently controlled for these two
835835
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
841842
optimizer sees an opportunity to avoid truncations; currently this has no
842-
effect beyond ``standard``)
843+
effect beyond ``standard``
843844

844845
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
846847
be supported on more targets as they define ABIs for it.
847848

848849
The ``__bf16`` type is a non-standard extension, but it generally follows
849850
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
852853
as they define ABIs for it.
853854

854855
The ``__fp16`` type was originally an ARM extension and is specified
855856
by the `ARM C Language Extensions <https://github.com/ARM-software/acle/releases>`_.
856857
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
858859
immediately promote ``__fp16`` operands to ``float``.
859860

860861
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,
870871

871872
Because default argument promotion only applies to the standard floating-point
872873
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
874875
certain library facilities with ``_Float16``; for example, there is no ``printf`` format
875876
specifier for ``_Float16``, and (unlike ``float``) it will not be implicitly promoted to
876877
``double`` when passed to ``printf``, so the programmer must explicitly cast it to

0 commit comments

Comments
 (0)