[clang] [clang] constexpr built-in reduce and function. (PR #116822)

via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 20 03:57:38 PST 2024


================
@@ -765,3 +765,11 @@ constexpr long long reduceMulLong2 = __builtin_reduce_mul((vector4long){(1LL <<
 // expected-note at -1 {{outside the range of representable values of type 'long long'}}
 static_assert(__builtin_reduce_mul((vector4uint){~0U, 1, 1, 2}) == ~0U - 1);
 static_assert(__builtin_reduce_mul((vector4ulong){~0ULL, 1, 1, 2}) == ~0ULL - 1);
+
+static_assert(__builtin_reduce_and((vector4char){}) == 0);
+static_assert(__builtin_reduce_and((vector4char){(char)0x11, (char)0x22, (char)0x44, (char)0x88}) == 0);
----------------
c8ef wrote:

Done.

https://github.com/llvm/llvm-project/pull/116822


More information about the cfe-commits mailing list