[clang] [X86][RFC] Refactor the SSE intrinsics constexpr tests to simplify future expansion (PR #112578)

Phoebe Wang via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 16 22:11:34 PDT 2024


================
@@ -6,13 +6,23 @@
 
 #include <immintrin.h>
 
+#if defined(__cplusplus) && (__cplusplus >= 201103L)
+constexpr bool match_m128(__m128 v, float x, float y, float z, float w) {
+  return v[0] == x && v[1] == y && v[2] == z && v[3] == w;
+}
+#define TEST_CONSTEXPR(...) static_assert(__VA_ARGS__)
+#else
+#define TEST_CONSTEXPR(...)
+#endif
+
----------------
phoebewang wrote:

Put this in a .h file and include in more tests?

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


More information about the cfe-commits mailing list