[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.
This commit is contained in:
DJ Delorie
2010-07-29 18:41:28 +00:00
parent d0d995612d
commit f9c7014e9c
12 changed files with 918 additions and 841 deletions

View File

@@ -94,6 +94,7 @@ main (int argc, char **argv)
int o;
int save_trace;
bfd *prog;
int rc;
/* By default, we exit when an execution error occurs. */
execution_error_init_standalone ();
@@ -178,33 +179,50 @@ main (int argc, char **argv)
sim_disasm_init (prog);
while (1)
enable_counting = verbose;
rc = setjmp (decode_jmp_buf);
if (rc == 0)
{
int rc;
if (trace)
printf ("\n");
if (disassemble)
sim_disasm_one ();
enable_counting = verbose;
rc = decode_opcode ();
enable_counting = 0;
if (RX_HIT_BREAK (rc))
done (1);
else if (RX_EXITED (rc))
done (RX_EXIT_STATUS (rc));
else if (RX_STOPPED (rc))
if (!trace && !disassemble)
{
if (verbose)
printf("Stopped on signal %d\n", RX_STOP_SIG (rc));
exit(1);
/* This will longjmp to the above if an exception
happens. */
for (;;)
decode_opcode ();
}
else
assert (RX_STEPPED (rc));
while (1)
{
trace_register_changes ();
if (trace)
printf ("\n");
if (disassemble)
{
enable_counting = 0;
sim_disasm_one ();
enable_counting = verbose;
}
rc = decode_opcode ();
if (trace)
trace_register_changes ();
}
}
if (RX_HIT_BREAK (rc))
done (1);
else if (RX_EXITED (rc))
done (RX_EXIT_STATUS (rc));
else if (RX_STOPPED (rc))
{
if (verbose)
printf("Stopped on signal %d\n", RX_STOP_SIG (rc));
exit(1);
}
done (0);
exit (0);
}