aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/xtensa
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2019-03-21 20:22:03 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2019-03-21 21:47:50 -0700
commitb9ec52188f1eafb2901d37a57727bbf1d8bbe3ca (patch)
tree9fc0259f9fa49c37ef235806cc953ccb8a534e3b /tests/tcg/xtensa
parent62a172e6a77d9072bb1a18f295ce0fcf4b90a4f2 (diff)
target/xtensa: fix break_dependency for repeated resources
break_dependency incorrectly handles the case of dependency on an opcode that references the same register multiple times. E.g. the following instruction is translated incorrectly: { or a2, a3, a3 ; or a3, a2, a2 } This happens because resource indices of both dependency graph nodes are incremented, and a copy for the second instance of the same register in the ending node is not done. Only increment resource index of the ending node of the dependency. Add test. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'tests/tcg/xtensa')
-rw-r--r--tests/tcg/xtensa/test_flix.S17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/tcg/xtensa/test_flix.S b/tests/tcg/xtensa/test_flix.S
index 7c259e7018..7af06b2b88 100644
--- a/tests/tcg/xtensa/test_flix.S
+++ b/tests/tcg/xtensa/test_flix.S
@@ -55,6 +55,23 @@ test sum
.previous
test_end
+test rep_dependency
+
+ {
+ movi a2, 1
+ movi a3, 2
+ nop
+ }
+ {
+ or a2, a3, a3
+ or a3, a2, a2
+ nop
+ }
+ assert eqi, a2, 2
+ assert eqi, a3, 1
+
+test_end
+
#endif
test_suite_end