Support ExtVectorType conditional operator
authorMin-Yih Hsu <minyihh@uci.edu>
Tue, 26 May 2020 06:27:34 +0000 (06:27 +0000)
committerMin-Yih Hsu <minyihh@uci.edu>
Tue, 2 Jun 2020 16:35:42 +0000 (16:35 +0000)
commit4431d64c10cb681986e752420f1136f259daa5a7
tree95acb763e1760654c990017dba8c325bf6cccf53
parentde04375ac59e6e9290b361b3ffcf4558e688e8a9
Support ExtVectorType conditional operator

Extension vectors now can be used in element-wise conditional selector.
For example:
```
R[i] = C[i]? A[i] : B[i]
```
This feature was previously only enabled in OpenCL C. Now it's also
available in C. Not that it has different behaviors than GNU vectors
(i.e. __vector_size__). Extension vectors selects on signdness of the
vector. GNU vectors on the other hand do normal bool conversions. Also,
this feature is not available in C++.

Differential Revision: https://reviews.llvm.org/D80574
clang/docs/LanguageExtensions.rst
clang/lib/CodeGen/CGExprScalar.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/Sema/ext_vector_comparisons.c