aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/xtensa/test_loop.S
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-01-10 13:10:42 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-12 10:03:28 -0600
commitc09015dd04e14a9b99250ed06fb5a47e2efa387f (patch)
treecc9e2078c44558a7d0e4ee9bd914383c6be130b5 /tests/tcg/xtensa/test_loop.S
parenta0f426109e17d579c2712f5b96a50215e6cc06a4 (diff)
tests: mv tests/* -> tests/tcg
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'tests/tcg/xtensa/test_loop.S')
-rw-r--r--tests/tcg/xtensa/test_loop.S77
1 files changed, 77 insertions, 0 deletions
diff --git a/tests/tcg/xtensa/test_loop.S b/tests/tcg/xtensa/test_loop.S
new file mode 100644
index 0000000000..a5ea933913
--- /dev/null
+++ b/tests/tcg/xtensa/test_loop.S
@@ -0,0 +1,77 @@
+.include "macros.inc"
+
+test_suite loop
+
+test loop
+ movi a2, 0
+ movi a3, 5
+ loop a3, 1f
+ addi a2, a2, 1
+1:
+ assert eqi, a2, 5
+test_end
+
+test loop0
+ movi a2, 0
+ loop a2, 1f
+ rsr a2, lcount
+ assert eqi, a2, -1
+ j 1f
+1:
+test_end
+
+test loop_jump
+ movi a2, 0
+ movi a3, 5
+ loop a3, 1f
+ addi a2, a2, 1
+ j 1f
+1:
+ assert eqi, a2, 1
+test_end
+
+test loop_branch
+ movi a2, 0
+ movi a3, 5
+ loop a3, 1f
+ addi a2, a2, 1
+ beqi a2, 3, 1f
+1:
+ assert eqi, a2, 3
+test_end
+
+test loop_manual
+ movi a2, 0
+ movi a3, 5
+ movi a4, 1f
+ movi a5, 2f
+ wsr a3, lcount
+ wsr a4, lbeg
+ wsr a5, lend
+ isync
+ j 1f
+.align 4
+1:
+ addi a2, a2, 1
+2:
+ assert eqi, a2, 6
+test_end
+
+test loop_excm
+ movi a2, 0
+ movi a3, 5
+ rsr a4, ps
+ movi a5, 0x10
+ or a4, a4, a5
+ wsr a4, ps
+ isync
+ loop a3, 1f
+ addi a2, a2, 1
+1:
+ xor a4, a4, a5
+ isync
+ wsr a4, ps
+ assert eqi, a2, 1
+test_end
+
+test_suite_end