[PATCH] D98055: [ExtVectorType] Support conditional select operator for C++.

Florian Hahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 5 09:42:07 PST 2021


fhahn created this revision.
fhahn added reviewers: rjmccall, erichkeane, aaron.ballman.
fhahn requested review of this revision.
Herald added a project: clang.

This patch implements the conditional select operator for
ext_vector_types in C++. It does so by using the same semantics as for
C.

D71463 <https://reviews.llvm.org/D71463> added support for the conditional select operator for VectorType
in C++. Unfortunately the semantics between ext_vector_type in C are
different to VectorType in C++. Select for ext_vector_type is based on
the MSB of the condition vector, whereas for VectorType it is `!= 0`.

This unfortunately means that the behavior is inconsistent between
ExtVectorType and VectorType, but I think using the C semantics for
ExtVectorType in C++ as well should be less surprising for users.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98055

Files:
  clang/include/clang/Sema/Sema.h
  clang/lib/Sema/SemaExprCXX.cpp
  clang/test/CodeGenCXX/ext-vector-type-conditional.cpp
  clang/test/CodeGenCXX/vector-conditional.cpp
  clang/test/CodeGenCXX/vector-size-conditional.cpp
  clang/test/SemaCXX/ext-vector-type-conditional.cpp
  clang/test/SemaCXX/vector-conditional.cpp
  clang/test/SemaCXX/vector-size-conditional.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98055.328560.patch
Type: text/x-patch
Size: 56572 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210305/500d48fd/attachment-0001.bin>


More information about the cfe-commits mailing list