Skip to contentSkip to conversation

target/xtensa: don't specify windowed registers manually

PATCH New Max Filippov 1 participant 1 message Feb 11, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/xtensa: don't specify windowed registers manually

Use libisa to extract whether opcode uses windowed registers and construct mask based on that. This only leaves special case for the 'entry' opcode, as it needs to probe a register dynamically.

---
 target/xtensa/cpu.h       |   2 +-
 target/xtensa/helper.c    |   1 +
 target/xtensa/translate.c | 493 +---------------------------------------------
 3 files changed, 12 insertions(+), 484 deletions(-)
target/xtensa/cpu.h +1 -1
index b665bfc0068a..f1861244720e 100644
@@ -380,7 +380,6 @@ typedef struct XtensaOpcodeOps {
     XtensaOpcodeUintTest test_overflow;
     const uint32_t *par;
     uint32_t op_flags;
-    uint32_t windowed_register_op;
     uint32_t coprocessor;
 } XtensaOpcodeOps;
 
@@ -438,6 +437,7 @@ struct XtensaConfig {
     xtensa_isa isa;
     XtensaOpcodeOps **opcode_ops;
     const XtensaOpcodeTranslators **opcode_translators;
+    xtensa_regfile a_regfile;
 
     uint32_t clock_freq_khz;
 
target/xtensa/helper.c +1 -0
index bcf2f20d4858..6cf1dbb8a69b 100644
@@ -88,6 +88,7 @@ static void init_libisa(XtensaConfig *config)
 #endif
         config->opcode_ops[i] = ops;
     }
+    config->a_regfile = xtensa_regfile_lookup(config->isa, "AR");
 }
 
 void xtensa_finalize_config(XtensaConfig *config)
target/xtensa/translate.c +10 -483

2,847 lines not on this page · raw message

Signature · 1 line
2.11.0