================
@@ -1,9 +1,25 @@
// RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-apple-darwin
-target-feature +pclmul -emit-llvm -o - | FileCheck %s
-
+// RUN: %clang_cc1 -x c++ -ffreestanding %s -triple=x86_64-apple-darwin
-target-feature +pclmul -emit-llvm -o - -std=c++11 | FileCheck %s
+// RUN: %clang_cc1 -x c++ -ffreestanding %s -triple=x86_64-apple-darwin
-target-feature +pclmul -emit-llvm -o - -std=c++11
-fexperimental-new-constant-interpreter | FileCheck %s
#include <wmmintrin.h>
+#include "builtin_test_helpers.h"
__m128i test_mm_clmulepi64_si128(__m128i a, __m128i b) {
// CHECK: @llvm.x86.pclmulqdq
return _mm_clmulepi64_si128(a, b, 0);
}
+
+// Test constexpr evaluation for _mm_clmulepi64_si128
+// imm8=0x00: lower 64 bits of both operands
+// Test case: 0x1 * 0x3 = 0x3 (carry-less multiplication)
+TEST_CONSTEXPR(match_m128i(_mm_clmulepi64_si128(((__m128i){0x1ULL, 0x0ULL}),
((__m128i){0x3ULL, 0x0ULL}), 0x00), 0x3ULL, 0x0ULL));
----------------
RKSimon wrote:
we need tests showing results in the upper 64-bits as well:
https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=clmul&ig_expand=754
https://github.com/llvm/llvm-project/pull/169214
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits