https://github.com/AaronBallman commented:
Also, please be sure to add a release note about the new functionality.
https://github.com/llvm/llvm-project/pull/91306
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/AaronBallman edited
https://github.com/llvm/llvm-project/pull/91306
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1176,6 +1176,12 @@ def ConvertVector : Builtin {
let Prototype = "void(...)";
}
+def SelectVector : Builtin {
+ let Spellings = ["__builtin_selectvector"];
+ let Attributes = [NoThrow, Const, CustomTypeChecking];
AaronBallman wrote:
Should this also
@@ -3013,6 +3013,62 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl,
unsigned BuiltinID,
break;
}
+ case Builtin::BI__builtin_selectvector: {
+if (checkArgCount(*this, TheCall, 3))
+ return ExprError();
+
+ExprResult LHS = TheCall->getArg(0);
+
@@ -3013,6 +3013,62 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl,
unsigned BuiltinID,
break;
}
+ case Builtin::BI__builtin_selectvector: {
+if (checkArgCount(*this, TheCall, 3))
+ return ExprError();
+
+ExprResult LHS = TheCall->getArg(0);
+
efriedma-quic wrote:
clang already supports `?:` with a vector condition; does this add anything new
on top of that?
https://github.com/llvm/llvm-project/pull/91306
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -41,6 +41,22 @@ typedef long long __m512i_u
__attribute__((__vector_size__(64), __aligned__(1)))
typedef unsigned char __mmask8;
typedef unsigned short __mmask16;
+#ifdef __cplusplus
+typedef bool __vecmask2 __attribute__((__ext_vector_type__(2)));
+typedef bool
@@ -77,9 +77,9 @@ _mm512_cvtne2ps_pbh(__m512 __A, __m512 __B) {
///conversion of __B, and higher 256 bits come from conversion of __A.
static __inline__ __m512bh __DEFAULT_FN_ATTRS512
_mm512_mask_cvtne2ps_pbh(__m512bh __W, __mmask32 __U, __m512 __A, __m512 __B) {
- return
@@ -41,6 +41,22 @@ typedef long long __m512i_u
__attribute__((__vector_size__(64), __aligned__(1)))
typedef unsigned char __mmask8;
typedef unsigned short __mmask16;
+#ifdef __cplusplus
+typedef bool __vecmask2 __attribute__((__ext_vector_type__(2)));
+typedef bool
@@ -3019,6 +3019,26 @@ C-style cast applied to each element of the first
argument.
Query for this feature with ``__has_builtin(__builtin_convertvector)``.
+``__builtin_selectvector``
+--
+
+``__builtin_selectvector`` is used to express generic vector
@@ -3744,6 +3744,12 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl
GD, unsigned BuiltinID,
return RValue::get(Result);
}
+ case Builtin::BI__builtin_selectvector: {
+return RValue::get(Builder.CreateSelect(EmitScalarExpr(E->getArg(2)),
https://github.com/RKSimon commented:
constexpr handling?
https://github.com/llvm/llvm-project/pull/91306
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -232,225 +232,225 @@ typedef char __v2qi __attribute__((__vector_size__(2)));
static __inline__ __m256i __DEFAULT_FN_ATTRS256
_mm256_mask_add_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m256i __B)
{
- return (__m256i)__builtin_ia32_selectd_256((__mmask8)__U,
-
@@ -3019,6 +3019,26 @@ C-style cast applied to each element of the first
argument.
Query for this feature with ``__has_builtin(__builtin_convertvector)``.
+``__builtin_selectvector``
+--
+
+``__builtin_selectvector`` is used to express generic vector
philnik777 wrote:
I don't understand why the order of emitted instructions changes based on how
exactly Clang is compiled, but other than that this should be ready. Hopefully
someone spots what the problem could be.
https://github.com/llvm/llvm-project/pull/91306
llvmbot wrote:
@llvm/pr-subscribers-clang
@llvm/pr-subscribers-backend-x86
@llvm/pr-subscribers-clang-codegen
Author: Nikolas Klauser (philnik777)
Changes
This is also very useful for generic code. For example this would allow libc++
to vectorize `{min,max,minmax}_element` without having
https://github.com/philnik777 ready_for_review
https://github.com/llvm/llvm-project/pull/91306
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/philnik777 edited
https://github.com/llvm/llvm-project/pull/91306
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff 09327efdf0f02c4f865a4536db96cac539bb1c01
25ab7acb3de4abaf6ad72eab3fa52227920f8518 --
https://github.com/philnik777 edited
https://github.com/llvm/llvm-project/pull/91306
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
20 matches
Mail list logo