From edc9603e2c8f488cbae4e67c02906ae343512ae6 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Thu, 29 Jul 2010 18:41:26 +0000 Subject: [PATCH] [include/opcode] * rx.h (RX_Operand_Type): Add TwoReg. (RX_Opcode_ID): Remove ediv and ediv2. [opcodes] * rx-decode.opc (SRR): New. (rx_decode_opcode): Use it for movbi and movbir. Decode NOP2 (mov r0,r0) and NOP3 (max r0,r0) special cases. * rx-decode.c: Regenerate. [sim/rx] * rx.c (decode_cache_base): New. (id_names): Remove ediv and edivu. (optype_names): Add TwoReg. (maybe_get_mem_page): New. (rx_get_byte): Call it. (get_op): Add TwoReg support. (put_op): Likewise. (PD, PS, PS2, GD, GS, GS2, DSZ, SSZ, S2SZ, US1, US2, OM): "opcode" is a pointer now. (DO_RETURN): New. We use longjmp to return an exception result. (decode_opcode): Make opcode a pointer to the decode cache. Save decoded opcode information and re-use. Call DO_RETURN instead of return throughout. Remove ediv and edivu. * mem.c (ptdc): New. Adds decode cache. (rx_mem_ptr): Support it. (rx_mem_decode_cache): New. * mem.h (enum mem_ptr_action): add MPA_DECODE_CACHE. (rx_mem_decode_cache): Declare. * gdb-if.c (sim_resume): Add decode_opcode's setjmp logic here... * main.c (main): ...and here. Use a fast loop if neither trace nor disassemble is given. * cpu.h (RX_MAKE_STEPPED, RX_MAKE_HIT_BREAK, RX_MAKE_EXITED, RX_MAKE_STOPPED, RX_EXITED, RX_STOPPED): Adjust so that 0 is not a valid code for anything. --- include/opcode/ChangeLog | 5 +++++ include/opcode/rx.h | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog index a49c2072e..de977c5b3 100644 --- a/include/opcode/ChangeLog +++ b/include/opcode/ChangeLog @@ -1,3 +1,8 @@ +2010-07-29 DJ Delorie + + * rx.h (RX_Operand_Type): Add TwoReg. + (RX_Opcode_ID): Remove ediv and ediv2. + 2010-07-27 DJ Delorie * rx.h (RX_Opcode_ID): Add nop2 and nop3 for statistics. diff --git a/include/opcode/rx.h b/include/opcode/rx.h index 0840be0a8..aa85fe4a9 100644 --- a/include/opcode/rx.h +++ b/include/opcode/rx.h @@ -47,6 +47,7 @@ typedef enum RX_Operand_Predec, /* [-Rn] */ RX_Operand_Condition, /* eq, gtu, etc */ RX_Operand_Flag, /* [UIOSZC] */ + RX_Operand_TwoReg, /* [Rn + scale*R2] */ } RX_Operand_Type; typedef enum @@ -82,8 +83,6 @@ typedef enum RXO_min, /* d = min(d,s) */ RXO_emul, /* d:64 = d:32 * s */ RXO_emulu, /* d:64 = d:32 * s (unsigned) */ - RXO_ediv, /* d:64 / s; d = quot, d+1 = rem */ - RXO_edivu, /* d:64 / s; d = quot, d+1 = rem */ RXO_rolc, /* d <<= 1 through carry */ RXO_rorc, /* d >>= 1 through carry*/