Browse Source
Print instruction description as comment in disassembly with s390 architecture specific option "insndesc": - For objdump it can be enabled with option "-M insndesc" - In gdb it can be enabled with "set disassembler-options insndesc" Since comments are not column aligned the output can enhanced for readability by postprocessing using a filter such as "expand": ... | expand -t 8,16,24,32,40,80 Or when using in combination with objdump option --visualize-jumps: ... | expand | sed -e 's/ *#/\t#/' | expand -t 1,80 Note that the instruction descriptions add about 128 KB to s390-opc.o: s390-opc.o without instruction descriptions: 216368 bytes s390-opc.o with instruction descriptions : 348432 bytes binutils/ * NEWS: Mention new s390-specific disassembler option "insndesc". include/ * opcode/s390.h (struct s390_opcode): Add field to hold instruction description. opcodes/ * s390-mkopc.c: Copy instruction description from s390-opc.txt into generated operation code table s390-opc.tab. * s390-opc.c (s390_opformats): Provide NULL as description in .insn pseudo-mnemonics opcode table. * s390-dis.c: Add s390-specific disassembler option "insndesc" and optionally print the instruction description as comment in the disassembly when it is specified. gas/ * testsuite/gas/s390/s390.exp: Add new test disassembly test case "zarch-insndesc". * testsuite/gas/s390/zarch-insndesc.s: New test case for s390- specific disassembler option "insndesc". * testsuite/gas/s390/zarch-insndesc.d: Likewise. Signed-off-by: Jens Remus <jremus@linux.ibm.com> Reviewed-by: Andreas Krebbel <krebbel@linux.ibm.com>binutils-2_42-branch
committed by
Andreas Krebbel
8 changed files with 92 additions and 40 deletions
@ -0,0 +1,17 @@ |
|||
#name: s390x insndesc |
|||
#objdump: -dr -M insndesc |
|||
|
|||
.*: +file format .* |
|||
|
|||
Disassembly of section .text: |
|||
|
|||
.* <foo>: |
|||
.*: b3 95 00 69 [ ]*cdfbr %f6,%r9 # convert from fixed 32 to long bfp |
|||
*([\da-f]+): 84 69 00 00 [ ]*brxh %r6,%r9,\1 <foo\+0x\1> # branch relative on index high |
|||
.*: b2 99 5f ff [ ]*srnm 4095\(%r5\) # set rounding mode |
|||
.*: b9 11 00 96 [ ]*lngfr %r9,%r6 # load negative 64<32 |
|||
.*: ec 67 92 1c 26 54 [ ]*rnsbgt %r6,%r7,18,28,38 # rotate then and selected bits and test results |
|||
.*: ec 67 0c 8d 0e 5d [ ]*risbhgz %r6,%r7,12,13,14 # rotate then insert selected bits high and zero remaining bits |
|||
.*: b3 96 37 59 [ ]*cxfbra %f5,3,%r9,7 # convert from 32 bit fixed to extended bfp with rounding mode |
|||
.*: ec 67 0c 94 0e 59 [ ]*risbgnz %r6,%r7,12,20,14 # rotate then insert selected bits and zero remaining bits nocc |
|||
.*: 07 07 [ ]*nopr %r7 # no operation |
|||
@ -0,0 +1,10 @@ |
|||
.text |
|||
foo: |
|||
cdfbr %f6,%r9 |
|||
brxh %r6,%r9,. |
|||
srnm 4095(%r5) |
|||
lngfr %r9,%r6 |
|||
rnsbgt %r6,%r7,18,28,38 |
|||
risbhgz %r6,%r7,12,13,14 |
|||
cxfbra %f5,3,%r9,7 |
|||
risbgnz %r6,%r7,12,20,14 |
|||
Loading…
Reference in new issue