comparison test/test_compare.h @ 17:41dd962abdd1

*: allow compiling vec in a C++ translation unit this is stupid, but whatever
author Paper <paper@tflc.us>
date Wed, 20 Nov 2024 12:02:15 -0500
parents e05c257c6a23
children 627d548b23c8
comparison
equal deleted inserted replaced
16:9da2aba90c87 17:41dd962abdd1
29 CREATE_TEST(sign, psign, bits, size, cmpeq, orig_a[i] == orig_b[i]) \ 29 CREATE_TEST(sign, psign, bits, size, cmpeq, orig_a[i] == orig_b[i]) \
30 CREATE_TEST(sign, psign, bits, size, cmple, orig_a[i] <= orig_b[i]) \ 30 CREATE_TEST(sign, psign, bits, size, cmple, orig_a[i] <= orig_b[i]) \
31 CREATE_TEST(sign, psign, bits, size, cmpge, orig_a[i] >= orig_b[i]) 31 CREATE_TEST(sign, psign, bits, size, cmpge, orig_a[i] >= orig_b[i])
32 32
33 #define CREATE_TESTS(bits, size) CREATE_TESTS_SIGN(, d, bits, size) CREATE_TESTS_SIGN(u, u, bits, size) 33 #define CREATE_TESTS(bits, size) CREATE_TESTS_SIGN(, d, bits, size) CREATE_TESTS_SIGN(u, u, bits, size)
34
35 CREATE_TESTS(8, 2)
36
37 CREATE_TESTS(8, 4)
38 CREATE_TESTS(16, 2)
34 39
35 CREATE_TESTS(8, 8) 40 CREATE_TESTS(8, 8)
36 CREATE_TESTS(16, 4) 41 CREATE_TESTS(16, 4)
37 CREATE_TESTS(32, 2) 42 CREATE_TESTS(32, 2)
38 43
74 79
75 #define RUN_TESTS(bits, size) \ 80 #define RUN_TESTS(bits, size) \
76 RUN_TESTS_SIGN( , bits, size) \ 81 RUN_TESTS_SIGN( , bits, size) \
77 RUN_TESTS_SIGN(u, bits, size) 82 RUN_TESTS_SIGN(u, bits, size)
78 83
84 RUN_TESTS(8, 2)
85
86 RUN_TESTS(8, 4)
87 RUN_TESTS(16, 2)
88
79 RUN_TESTS(8, 8) 89 RUN_TESTS(8, 8)
80 RUN_TESTS(16, 4) 90 RUN_TESTS(16, 4)
81 RUN_TESTS(32, 2) 91 RUN_TESTS(32, 2)
82 92
83 RUN_TESTS(8, 16) 93 RUN_TESTS(8, 16)