aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2018-10-03 12:43:54 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2019-02-28 04:43:23 -0800
commitebbd775aab3a15b3d631e6a262353ece4575fcf5 (patch)
tree3af701985563d1dc01621173731eb01617c4de36 /tests/tcg
parent3db8a95e70be544af5969a54da5fad5ddc3090e1 (diff)
tests/tcg/xtensa: add test for FLIX
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'tests/tcg')
-rw-r--r--tests/tcg/xtensa/Makefile1
-rw-r--r--tests/tcg/xtensa/test_flix.S60
2 files changed, 61 insertions, 0 deletions
diff --git a/tests/tcg/xtensa/Makefile b/tests/tcg/xtensa/Makefile
index aee0134ef5..bd94ba6fe5 100644
--- a/tests/tcg/xtensa/Makefile
+++ b/tests/tcg/xtensa/Makefile
@@ -38,6 +38,7 @@ TESTCASES += test_cache.tst
TESTCASES += test_clamps.tst
TESTCASES += test_extui.tst
TESTCASES += test_fail.tst
+TESTCASES += test_flix.tst
TESTCASES += test_interrupt.tst
TESTCASES += test_loop.tst
TESTCASES += test_mac16.tst
diff --git a/tests/tcg/xtensa/test_flix.S b/tests/tcg/xtensa/test_flix.S
new file mode 100644
index 0000000000..7c259e7018
--- /dev/null
+++ b/tests/tcg/xtensa/test_flix.S
@@ -0,0 +1,60 @@
+#include "macros.inc"
+
+test_suite flix
+
+#if XCHAL_HAVE_FLIX3
+
+test misc
+ {
+ mov a3, a4
+ mov a2, a3
+ nop
+ }
+ {
+ nop
+ bne.w18 a2, a3, 1f
+ }
+ movi a2, 1f
+ {
+ mov a2, a3
+ mov a3, a2
+ nop
+ }
+ {
+ l32i a2, a3, 0
+ add a4, a4, a2
+ nop
+ }
+ {
+ mov a3, a4
+ jx a3
+ nop
+ }
+1:
+test_end
+
+test sum
+
+ movi a2, 0
+ movi a3, 2f
+ movi a4, 0
+ movi a5, 4
+
+ loop a5, 1f
+ {
+ l32i a2, a3, 0
+ addi a3, a3, 4
+ add a4, a4, a2
+ }
+1:
+ add a4, a4, a2
+ assert eqi, a4, 10
+ .data
+2:
+ .word 1, 2, 3, 4
+ .previous
+test_end
+
+#endif
+
+test_suite_end