RISC-V qemu has bug on the return value of function qemu_plugin_mem_size_shift()
hi in TCG plugin for RISC-V (qemu built by ./configure --target-list=riscv64-softmmu), the return value of function qemu_plugin_mem_size_shift() is wrong because
sb return 2
sh return 4
sw return 8
sd return 8
/home/peter/2TB/workspace/riscv-simulator/src/test/resources/hk/quantr/riscv_simulator/elf/test_qemu_memory_byte_size>cat cpu.log|grep -e store -e s[bhdw]
0x80000028: 00730023 sb t2,0(t1)
> mem store (RAM), 0x80001000, 0x80001000, 0x99, 2
0x80000054: 00731023 sh t2,0(t1)
> mem store (RAM), 0x80001008, 0x80001008, 0xef99, 4
0x80000080: 00732023 sw t2,0(t1)
> mem store (RAM), 0x80001010, 0x80001010, 0xabcdef99, 8
0x800000ac: 00733023 sd t2,0(t1)
> mem store (RAM), 0x80001018, 0x80001018, 0x12345678abcdef99, 8
thanks Peter
Edited by Peter