Decoding the opcodes in the right order reduces by 100+ lines.
Also, it happens to put the opcodes in the same order as Chapter 17.
Signed-off-by: Richard Henderson <address@hidden>
---
target-openrisc/translate.c | 300 ++++++++++++++------------------------------
1 file changed, 94 insertions(+), 206 deletions(-)
diff --git a/target-openrisc/translate.c b/target-openrisc/translate.c
index 9a8f886..c9e3198 100644
--- a/target-openrisc/translate.c
+++ b/target-openrisc/translate.c
@@ -419,267 +419,155 @@ static void dec_calc(DisasContext *dc, uint32_t insn)
rb = extract32(insn, 11, 5);
rd = extract32(insn, 21, 5);
- switch (op0) {
-
- case 0x000c:
- switch (op1) {
- case 0x00:
+ case 0xc:
switch (op2) {
- case 0x00: /* l.exths */
+ case 0: /* l.exths */
LOG_DIS("l.exths r%d, r%d\n", rd, ra);
tcg_gen_ext16s_tl(cpu_R[rd], cpu_R[ra]);