diff test/main.c @ 9:6ff0b7a44bb6

generic: add initial support for 256-bit and 512-bit types eventually this could be expanded to add floating point stuff as well
author Paper <paper@tflc.us>
date Mon, 18 Nov 2024 13:52:09 -0500
parents 75ab77f874e2
children d1d5d767004c
line wrap: on
line diff
--- a/test/main.c	Wed Oct 23 19:05:34 2024 -0400
+++ b/test/main.c	Mon Nov 18 13:52:09 2024 -0500
@@ -56,14 +56,7 @@
 		return v##sign##int##bits##x##size##_load_aligned(x); \
 	}
 
-#define VTEST_SIGN(bits, size) VTEST(, , bits, size) VTEST(u, U, bits, size)
-
-VTEST_SIGN(8, 16)
-VTEST_SIGN(16, 8)
-VTEST_SIGN(32, 4)
-VTEST_SIGN(64, 2)
-
-#define DEFINE_PRINT_VECTOR(sign, csign, psign, bits, size) \
+#define VPRINT(sign, csign, psign, bits, size) \
 	static inline void print_v##sign##int##bits##x##size(FILE *file, v##sign##int##bits##x##size vec) \
 	{ \
 		fputs("vector: ", file); \
@@ -81,17 +74,37 @@
 	\
 	}
 
-#define DEFINE_PRINT_VECTOR_2(bits, size) DEFINE_PRINT_VECTOR(, , d, bits, size) DEFINE_PRINT_VECTOR(u, U, u, bits, size)
+#define DEF_VEC_TEST_FUNCS(bits, size) \
+	VTEST(, , bits, size)     VTEST(u, U, bits, size) \
+	VPRINT(, , d, bits, size) VPRINT(u, U, u, bits, size)
+
+DEF_VEC_TEST_FUNCS(8, 16)
+DEF_VEC_TEST_FUNCS(16, 8)
+DEF_VEC_TEST_FUNCS(32, 4)
+DEF_VEC_TEST_FUNCS(64, 2)
 
-DEFINE_PRINT_VECTOR_2(8, 16)
-DEFINE_PRINT_VECTOR_2(16, 8)
-DEFINE_PRINT_VECTOR_2(32, 4)
-DEFINE_PRINT_VECTOR_2(64, 2)
+DEF_VEC_TEST_FUNCS(8, 32)
+DEF_VEC_TEST_FUNCS(16, 16)
+DEF_VEC_TEST_FUNCS(32, 8)
+DEF_VEC_TEST_FUNCS(64, 4)
+
+DEF_VEC_TEST_FUNCS(8, 64)
+DEF_VEC_TEST_FUNCS(16, 32)
+DEF_VEC_TEST_FUNCS(32, 16)
+DEF_VEC_TEST_FUNCS(64, 8)
+
+#undef DEF_VEC_TEST_FUNCS
+#undef VPRINT
+#undef VTEST
+
+// ------------------------------------------------------------
 
 #include "test_align.h"
 #include "test_arith.h"
 #include "test_compare.h"
 
+// ------------------------------------------------------------
+
 int main(void)
 {
 	int ret = 0;