[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/14] target/xtensa: fix break_dependency for repea
From: |
Daniel P . Berrangé |
Subject: |
[Qemu-devel] [PATCH 01/14] target/xtensa: fix break_dependency for repeated resources |
Date: |
Fri, 29 Mar 2019 11:10:51 +0000 |
From: Max Filippov <address@hidden>
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 <address@hidden>
---
target/xtensa/translate.c | 1 -
tests/tcg/xtensa/test_flix.S | 17 +++++++++++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index 77bc04d6b0..65561d2c49 100644
--- a/target/xtensa/translate.c
+++ b/target/xtensa/translate.c
@@ -1041,7 +1041,6 @@ static bool break_dependency(struct slot_prop *a,
copy[n].resource = b->in[j].resource;
copy[n].arg = b->arg + index;
++n;
- ++i;
++j;
rv = true;
}
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
--
2.20.1
- [Qemu-devel] [PATCH 00/14] misc set of fixes for warnings under GCC 9, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 01/14] target/xtensa: fix break_dependency for repeated resources,
Daniel P . Berrangé <=
- [Qemu-devel] [PATCH 02/14] target/xtensa: don't announce exit simcall, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 03/14] tests/tcg/xtensa: clean up test set, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 04/14] linux-user: avoid string truncation warnings in uname field copying, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 05/14] linux-user: avoid string truncation warnings in elf field copying, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 06/14] sockets: avoid string truncation warnings when copying UNIX path, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 07/14] hw/usb: avoid format truncation warning when formatting port name, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 09/14] usb-mtp: fix string length for filename when writing metadata, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 08/14] qxl: avoid unaligned pointer reads/writes, Daniel P . Berrangé, 2019/03/29
- [Qemu-devel] [PATCH 10/14] usb-mtp: avoid warning about unaligned access to filename, Daniel P . Berrangé, 2019/03/29