diff options
author | Christoph Müllner <christoph.muellner@vrull.eu> | 2023-07-11 09:50:51 +0200 |
---|---|---|
committer | Alistair Francis <alistair.francis@wdc.com> | 2023-07-19 14:30:04 +1000 |
commit | 36df75a0a903c8ba3e2e28eb7162c43f8dd5d8f0 (patch) | |
tree | 4e58974b0397360c4431bb7be6b81061f67b0c7f /target/riscv | |
parent | 542c8776cabd94c8afa0524e989bc26119b42d10 (diff) | |
download | qemu-36df75a0a903c8ba3e2e28eb7162c43f8dd5d8f0.zip qemu-36df75a0a903c8ba3e2e28eb7162c43f8dd5d8f0.tar.gz qemu-36df75a0a903c8ba3e2e28eb7162c43f8dd5d8f0.tar.bz2 |
riscv/disas: Fix disas output of upper immediates
The GNU assembler produces the following output for instructions
with upper immediates:
00002597 auipc a1,0x2
000024b7 lui s1,0x2
6409 lui s0,0x2 # c.lui
The immediate operands of upper immediates are not shifted.
However, the QEMU disassembler prints them shifted:
00002597 auipc a1,8192
000024b7 lui s1,8192
6409 lui s0,8192 # c.lui
The current implementation extracts the immediate bits and shifts the by 12,
so the internal representation of the immediate is the actual immediate.
However, the immediates are later printed using rv_fmt_rd_imm or
rv_fmt_rd_offset, which don't undo the shift.
Let's fix this by using specific output formats for instructions
with upper immediates, that take care of the shift.
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20230711075051.1531007-1-christoph.muellner@vrull.eu>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'target/riscv')
0 files changed, 0 insertions, 0 deletions