[PATCH] D80574: [ExtVector] Support ExtVectorType conditional operator

Min-Yih Hsu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 26 10:17:15 PDT 2020


myhsu created this revision.
myhsu added reviewers: Anastasia, bader, hfinkel, erichkeane.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

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++.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80574

Files:
  clang/docs/LanguageExtensions.rst
  clang/lib/CodeGen/CGExprScalar.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/test/Sema/ext_vector_comparisons.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80574.266250.patch
Type: text/x-patch
Size: 4817 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200526/7e2ede82/attachment-0001.bin>


More information about the cfe-commits mailing list