mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
target/riscv: progressively load the instruction during decode
The plugin system would throw up a harmless warning when it detected that a disassembly of an instruction didn't use all it's bytes. Fix the riscv decoder to only load the instruction bytes it needs as it needs them. This drops opcode from the ctx in favour if passing the appropriately sized opcode down a few levels of the decode. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Robert Foley <robert.foley@linaro.org> Message-Id: <20200225124710.14152-15-alex.bennee@linaro.org>
This commit is contained in:
parent
ed04c8b14c
commit
25139bf7f8
2 changed files with 25 additions and 23 deletions
|
@ -344,8 +344,8 @@ enum {
|
|||
#define GET_C_LW_IMM(inst) ((extract32(inst, 6, 1) << 2) \
|
||||
| (extract32(inst, 10, 3) << 3) \
|
||||
| (extract32(inst, 5, 1) << 6))
|
||||
#define GET_C_LD_IMM(inst) ((extract32(inst, 10, 3) << 3) \
|
||||
| (extract32(inst, 5, 2) << 6))
|
||||
#define GET_C_LD_IMM(inst) ((extract16(inst, 10, 3) << 3) \
|
||||
| (extract16(inst, 5, 2) << 6))
|
||||
#define GET_C_J_IMM(inst) ((extract32(inst, 3, 3) << 1) \
|
||||
| (extract32(inst, 11, 1) << 4) \
|
||||
| (extract32(inst, 2, 1) << 5) \
|
||||
|
@ -363,7 +363,7 @@ enum {
|
|||
#define GET_C_RD(inst) GET_RD(inst)
|
||||
#define GET_C_RS1(inst) GET_RD(inst)
|
||||
#define GET_C_RS2(inst) extract32(inst, 2, 5)
|
||||
#define GET_C_RS1S(inst) (8 + extract32(inst, 7, 3))
|
||||
#define GET_C_RS2S(inst) (8 + extract32(inst, 2, 3))
|
||||
#define GET_C_RS1S(inst) (8 + extract16(inst, 7, 3))
|
||||
#define GET_C_RS2S(inst) (8 + extract16(inst, 2, 3))
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue