target/xtensa: sort FLIX instruction opcodes
PATCH v2 9/40 target/xtensa: sort FLIX instruction opcodes
Opcodes in different slots may read and write same resources (registers, states). In the absence of resource dependency loops it must be possible to sort opcodes to avoid interference.
Record resources used by each opcode in the bundle. Build opcode dependency graph and use topological sort to order its nodes. In case of success translate opcodes in sort order. In case of failure report and raise invalid opcode exception.
Signed-off-by Max Filippov <[email protected]>
---
Changes v1->v2:
- fix build with clang
target/xtensa/cpu.h | 2 + target/xtensa/translate.c | 227 ++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 221 insertions(+), 8 deletions(-)
target/xtensa/cpu.h +2 -0
@@ -373,6 +373,8 @@ enum {XTENSA_OP_EXIT_TB_0 =0x800 ,XTENSA_OP_NAME_ARRAY =0x8000 , + + XTENSA_OP_CONTROL_FLOW = 0x10000, }; typedef struct XtensaOpcodeOps {
target/xtensa/translate.c +219 -8
252 lines not on this page · raw message
Signature · 1 line
2.11.0