summaryrefslogtreecommitdiffstats
path: root/docs/ReleaseNotes.rst
diff options
context:
space:
mode:
authorSimon Dardis <simon.dardis@imgtec.com>2017-08-22 10:01:35 +0000
committerSimon Dardis <simon.dardis@imgtec.com>2017-08-22 10:01:35 +0000
commit168709d3443ba545a95593edc3a9028e26f5ff55 (patch)
treea4893e8f29530f75b5f439c47f1edeb758bd8818 /docs/ReleaseNotes.rst
parent923bd8236e1a0c6009de8d932bf9a0da7ec94b58 (diff)
[Sema] Update release notes with details of implicit scalar to vector conversions
Add notes on this to the C language section, along with the C++ section. Reviewers: bruno, hans Differential Revision: https://reviews.llvm.org/D36954 git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_50@311441 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/ReleaseNotes.rst')
-rw-r--r--docs/ReleaseNotes.rst40
1 files changed, 39 insertions, 1 deletions
diff --git a/docs/ReleaseNotes.rst b/docs/ReleaseNotes.rst
index 13766f0404..55ef35d2f6 100644
--- a/docs/ReleaseNotes.rst
+++ b/docs/ReleaseNotes.rst
@@ -116,7 +116,41 @@ Clang's support for building native Windows programs ...
C Language Changes in Clang
---------------------------
-- ...
+- Added near complete support for implicit scalar to vector conversion, a GNU
+ C/C++ language extension. With this extension, the following code is
+ considered valid:
+
+.. code-block:: c
+
+ typedef unsigned v4i32 __attribute__((vector_size(16)));
+
+ v4i32 foo(v4i32 a) {
+ // Here 5 is implicitly casted to an unsigned value and replicated into a
+ // vector with as many elements as 'a'.
+ return a + 5;
+ }
+
+The implicit conversion of a scalar value to a vector value--in the context of
+a vector expression--occurs when:
+
+- The type of the vector is that of a ``__attribute__((vector_size(size)))``
+ vector, not an OpenCL ``__attribute__((ext_vector_type(size)))`` vector type.
+
+- The scalar value can be casted to that of the vector element's type without
+ the loss of precision based on the type of the scalar and the type of the
+ vector's elements.
+
+- For compile time constant values, the above rule is weakened to consider the
+ value of the scalar constant rather than the constant's type.
+
+- Floating point constants with precise integral representations are not
+ implicitly converted to integer values, this is for compatability with GCC.
+
+
+Currently the basic integer and floating point types with the following
+operators are supported: ``+``, ``/``, ``-``, ``*``, ``%``, ``>``, ``<``,
+``>=``, ``<=``, ``==``, ``!=``, ``&``, ``|``, ``^`` and the corresponding
+assignment operators where applicable.
...
@@ -128,6 +162,10 @@ C11 Feature Support
C++ Language Changes in Clang
-----------------------------
+- As mentioned in `C Language Changes in Clang`_, Clang's support for
+ implicit scalar to vector conversions also applies to C++. Additionally
+ the following operators are also supported: ``&&`` and ``||``.
+
...
C++1z Feature Support