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

Aiden Grossman via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 19 15:33:30 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
+
----------------
boomanaiden154 wrote:

Is the plan to do that in this patch or a later one? I think it would make sense to do here given the duplication between the SSE builtin tests.

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


More information about the cfe-commits mailing list