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

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 18 08:12:37 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
+
----------------
RKSimon wrote:

Yes I think we should - I'm going to wait until I've found any more design issues but will move it into a common header soon.

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


More information about the cfe-commits mailing list