Make tests for optional instruction groups conditional on the presence
of corresponding options in the config.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
12 files changed:
test_suite clamps
+#if XCHAL_HAVE_CLAMPS
+
test clamps
movi a2, 0
movi a3, 0
assert eq, a3, a2
test_end
+#endif
+
test_suite_end
test_suite loop
+#if XCHAL_HAVE_LOOPS
+
test loop
movi a2, 0
movi a3, 5
1:
test_end
+#endif
+
test_suite_end
test_suite mac16
+#if XCHAL_HAVE_MAC16
+
#define ext16(v) (((v) & 0xffff) | (((v) & 0x8000) * 0x1ffffffe))
#define mul16(a, b) ((ext16(a) * ext16(b)))
.text
test_end
+#endif
+
test_suite_end
test_suite max
+#if XCHAL_HAVE_MINMAX
+
test max
movi a2, 0xffffffff
movi a3, 1
assert eq, a3, a4
test_end
+#endif
+
test_suite_end
test_suite min
+#if XCHAL_HAVE_MINMAX
+
test min
movi a2, 0xffffffff
movi a3, 1
assert eq, a3, a4
test_end
+#endif
+
test_suite_end
test_suite mul16
+#if XCHAL_HAVE_MUL16
+
test mul16u_pp
movi a2, 0x137f5a5a
mov a3, a2
assert eq, a3, a6
test_end
+#endif
+
test_suite_end
test_suite mul32
+#if XCHAL_HAVE_MUL32
+
test mull
movi a2, 0x137f5a5a
mov a3, a2
assert eq, a3, a6
test_end
+#endif
+
/* unfortunately dc232b doesn't have muluh/mulsh*/
test_suite_end
test_suite nsa
+#if XCHAL_HAVE_NSA
+
test nsa
movi a2, 0
movi a3, 31
assert eq, a3, a2
test_end
+#endif
+
test_suite_end
test_suite quo
+#if XCHAL_HAVE_DIV32
+
test quou_pp
movi a2, 0x5a5a137f
mov a3, a2
assert eq, a2, a3
test_end
+#endif
+
test_suite_end
test_suite rem
+#if XCHAL_HAVE_DIV32
+
test remu_pp
movi a2, 0x5a5a137f
mov a3, a2
assert eq, a2, a3
test_end
+#endif
+
test_suite_end
assert eq, a4, a6
test_end
+#if XCHAL_HAVE_ADDX
+
test addx2
movi a2, 0x137fa5a5
mov a3, a2
assert eq, a4, a6
test_end
+#endif
+
test sub
movi a2, 0x137fa5a5
mov a3, a2
assert eq, a4, a6
test_end
+#if XCHAL_HAVE_ADDX
+
test subx2
movi a2, 0x137fa5a5
mov a3, a2
assert eq, a4, a6
test_end
+#endif
+
test_suite_end
test_suite sext
+#if XCHAL_HAVE_SEXT
+
test sext
movi a2, 0xffffff5a
movi a3, 0x0000005a
assert eq, a3, a2
test_end
+#endif
+
test_suite_end