DLTcollab/sse2neon

Simplify `_mm_cmpestr` test cases

jserv opened this issue · 0 comments

jserv commented

File tests/impl.cpp contains some unattractive code as following:

#define MM_CMPESTRI_UBYTE_TEST_CASES(f, ...)                                  \
    f(UBYTE_OPS_CMP_EQUAL_ANY_LEAST_SIGNIFICANT_NEGATIVE_POLARITY,            \
      __VA_ARGS__) f(UBYTE_OPS_CMP_EQUAL_EACH_LEAST_SIGNIFICANT, __VA_ARGS__) \
        f(UBYTE_OPS_CMP_RANGES_LEAST_SIGNIFICANT, __VA_ARGS__)                \
            f(UBYTE_OPS_CMP_EQUAL_ORDERED_LEAST_SIGNIFICANT, __VA_ARGS__)

#define MM_CMPESTRI_SBYTE_TEST_CASES(f, ...)                       \
    f(SBYTE_OPS_CMP_EQUAL_EACH_LEAST_SIGNIFICANT, __VA_ARGS__)     \
        f(SBYTE_OPS_CMP_EQUAL_ANY_LEAST_SIGNIFICANT, __VA_ARGS__)  \
            f(SBYTE_OPS_CMP_RANGES_LEAST_SIGNIFICANT, __VA_ARGS__) \
                f(SBYTE_OPS_CMP_EQUAL_ORDERED_LEAST_SIGNIFICANT, __VA_ARGS__)

They are hard to maintain, and clang-format even misinterprets as nested statements. Let's think of some approaches to simplify them.