disas/riscv: Fix incorrect disassembly for `imm20` operand.
PATCH 1/1 disas/riscv: Fix incorrect disassembly for `imm20` operand.
From: Wei Wu <[email protected]>
imm20 operand type is used in LUI/AUIPC and other instructions. The value should not be left shifted 12bits for disassembly output.
--- disas/riscv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
disas/riscv.c +1 -1
@@ -2083,7 +2083,7 @@ static int32_t operand_imm12(rv_inst inst)static int32_t operand_imm20 (rv_inst inst) { -return (((int64_t )inst <<32 ) >>44 ) <<12 ; +return ((int64_t )inst <<32 ) >>44 ; }static int32_t operand_jimm20 (rv_inst inst)
Signature · 1 line
2.17.1
Quoted 6 lines · On Tue, 2020-07-07 at 18:09 +0800, [email protected] wrote:
From: Wei Wu <[email protected]>
imm20operand type is used in LUI/AUIPC and other instructions. The value should not be left shifted 12bits for disassembly output.Signed-off-by Wei Wu <[email protected]>
Hello,
Thanks for the patch.
Can you please send it again and make sure you CC the QEMU mailing list? https://lists.nongnu.org/mailman/listinfo/qemu-devel
Alistair
Quoted 17 lines
--- disas/riscv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)disas/riscv.c +1
-1@@ -2083,7 +2083,7 @@ static int32_t operand_imm12(rv_inst inst)static int32_t operand_imm20 (rv_inst inst) { -return (((int64_t )inst <<32 ) >>44 ) <<12 ; +return ((int64_t )inst <<32 ) >>44 ; }static int32_t operand_jimm20 (rv_inst inst)
Hi Alistair,
Thank you for your quick response. I've sent the patch to the qemu-devel.
Quoted 35 lines · Alistair Francis
Quoted 6 lines · On Tue, 2020-07-07 at 18:09 +0800, [email protected] wrote:
From: Wei Wu <[email protected]>
imm20operand type is used in LUI/AUIPC and other instructions. The value should not be left shifted 12bits for disassembly output.Signed-off-by Wei Wu <[email protected]>Hello,
Thanks for the patch.
Can you please send it again and make sure you CC the QEMU mailing list? https://lists.nongnu.org/mailman/listinfo/qemu-devel
Alistair
Quoted 17 lines
--- disas/riscv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)disas/riscv.c +1
-1@@ -2083,7 +2083,7 @@ static int32_t operand_imm12(rv_inst inst)static int32_t operand_imm20 (rv_inst inst) { -return (((int64_t )inst <<32 ) >>44 ) <<12 ; +return ((int64_t )inst <<32 ) >>44 ; }static int32_t operand_jimm20 (rv_inst inst)
Signature · 2 lines
Best wishes, Wei Wu (吴伟)