Skip to content

Commit ed63454

Browse files
committed
Update documentation and release notes to match the state of
-flax-vector-conversions on the Clang 10 release branch.
1 parent b079266 commit ed63454

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

clang/docs/CommandGuide/clang.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,18 @@ Language Selection and Mode Options
278278
Make all string literals default to writable. This disables uniquing of
279279
strings and other optimizations.
280280

281-
.. option:: -flax-vector-conversions
281+
.. option:: -flax-vector-conversions, -flax-vector-conversions=<kind>, -fno-lax-vector-conversions
282282

283283
Allow loose type checking rules for implicit vector conversions.
284+
Possible values of <kind>:
285+
286+
- ``none``: allow no implicit conversions between vectors
287+
- ``integer``: allow implicit bitcasts between integer vectors of the same
288+
overall bit-width
289+
- ``all``: allow implicit bitcasts between any vectors of the same
290+
overall bit-width
291+
292+
<kind> defaults to ``integer`` if unspecified.
284293

285294
.. option:: -fblocks
286295

clang/docs/ReleaseNotes.rst

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,13 @@ Non-comprehensive list of changes in this release
102102
the found gcc installation is older than 4.7.0. Add ``-fno-use-init-array`` to
103103
get the old behavior (``.ctors``).
104104

105-
* Lax vector conversions involving floating-point vectors have been disabled
106-
by default, and can no longer be enabled with ``-flax-vector-conversions``.
107-
This matches the behavior of these flags in GCC, but code relying on implicit
108-
vector bitcasts between integer and floating-point types that used to compile
109-
with older versions of Clang is no longer accepted by default in Clang 10.
110-
The old behavior can be restored with ``-flax-vector-conversions=all``.
111-
In a future release of Clang, we intend to change the default to
112-
``-fno-lax-vector-conversions``.
105+
* The behavior of the flag ``-flax-vector-conversions`` has been modified to
106+
more closely match GCC, as described below. In Clang 10 onwards, command lines
107+
specifying this flag do not permit implicit vector bitcasts between integer
108+
vectors and floating-point vectors. Such conversions are still permitted by
109+
default, however, and the default can be explicitly requested with the
110+
Clang-specific flag ``-flax-vector-conversions=all``. In a future release of
111+
Clang, we intend to change the default to ``-fno-lax-vector-conversions``.
113112

114113
New Compiler Flags
115114
------------------
@@ -142,19 +141,21 @@ Modified Compiler Flags
142141
to the ``-march`` flag, overriding the target provided by ``-triple``.
143142

144143
- ``-flax-vector-conversions`` has been split into three different levels of
145-
laxness:
144+
laxness, and has been updated to match the GCC semantics:
146145

147-
- ``-flax-vector-conversions=all``: This is Clang's historical default, and
146+
- ``-flax-vector-conversions=all``: This is Clang's current default, and
148147
permits implicit vector conversions (performed as bitcasts) between any
149148
two vector types of the same overall bit-width.
149+
Former synonym: ``-flax-vector-conversions`` (Clang <= 9).
150150

151-
- ``-flax-vector-conversions=integer``: This is Clang's current default,
152-
and permits implicit vector conversions (performed as bitcasts) between
153-
any two integer vector types of the same overall bit-width.
154-
Synonym: ``-flax-vector-conversions``.
151+
- ``-flax-vector-conversions=integer``: This permits implicit vector
152+
conversions (performed as bitcasts) between any two integer vector types of
153+
the same overall bit-width.
154+
Synonym: ``-flax-vector-conversions`` (Clang >= 10).
155155

156156
- ``-flax-vector-conversions=none``: Do not perform any implicit bitcasts
157-
between vector types. Synonym: ``-fno-lax-vector-conversions``.
157+
between vector types.
158+
Synonym: ``-fno-lax-vector-conversions``.
158159

159160
New Pragmas in Clang
160161
--------------------

0 commit comments

Comments
 (0)