aboutsummaryrefslogtreecommitdiff
path: root/opcodes/cr16-dis.c
diff options
context:
space:
mode:
authorTsukasa OI <research_trasio@irq.a4lg.com>2022-11-18 07:47:42 +0000
committerTsukasa OI <research_trasio@irq.a4lg.com>2022-11-28 01:03:18 +0000
commit97f006bc56afa41b3c5d4c4b0d0936aaf83b15d5 (patch)
tree6206ed1959bc63d10b8604495d70615561e70133 /opcodes/cr16-dis.c
parent2dc5f504c33a40a6731c588cf9526f4da3fc9ce7 (diff)
downloadgdb-97f006bc56afa41b3c5d4c4b0d0936aaf83b15d5.zip
gdb-97f006bc56afa41b3c5d4c4b0d0936aaf83b15d5.tar.gz
gdb-97f006bc56afa41b3c5d4c4b0d0936aaf83b15d5.tar.bz2
RISC-V: Better support for long instructions (disassembler)
Commit bb996692bd96 ("RISC-V/gas: allow generating up to 176-bit instructions with .insn") tried to start supporting long instructions but it was insufficient. On the disassembler, correct ".byte" output was limited to the first 64-bits of an instruction. After that, zeroes are incorrectly printed. Note that, it only happens on ".byte" output (instruction part) and not on hexdump (data) part. For example, before this commit, hexdump and ".byte" produces different values: Assembly: .insn 22, 0xfedcba98765432100123456789abcdef55aa33cc607f objdump output example (before the fix): 10: 607f 33cc 55aa cdef .byte 0x7f, 0x60, 0xcc, 0x33, 0xaa, 0x55, 0xef, 0xcd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 18: 89ab 4567 0123 3210 20: 7654 ba98 fedc Note that, after 0xcd (after first 64-bits of the target instruction), all ".byte" values are incorrectly printed as zero while hexdump prints correct instruction bits. To resolve this, this commit adds "packet" argument to support dumping instructions longer than 64-bits (to print correct instruction bits on ".byte"). This commit will be tested on the separate commit. Assembly: .insn 22, 0xfedcba98765432100123456789abcdef55aa33cc607f objdump output example (after the fix): 10: 607f 33cc 55aa cdef .byte 0x7f, 0x60, 0xcc, 0x33, 0xaa, 0x55, 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x10, 0x32, 0x54, 0x76, 0x98, 0xba, 0xdc, 0xfe 18: 89ab 4567 0123 3210 20: 7654 ba98 fedc opcodes/ChangeLog: * riscv-dis.c (riscv_disassemble_insn): Print unknown instruction using the new argument packet. (riscv_disassemble_data): Add unused argument packet. (print_insn_riscv): Pass packet to the disassemble function.
Diffstat (limited to 'opcodes/cr16-dis.c')
0 files changed, 0 insertions, 0 deletions