public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] s390: Optionally print instruction description in disassembly
@ 2023-12-08 16:03 Jens Remus
  2023-12-08 16:03 ` [PATCH 1/2] s390: Fix build when using EXEEXT_FOR_BUILD Jens Remus
  2023-12-08 16:03 ` [PATCH 2/2] s390: Optionally print instruction description in disassembly Jens Remus
  0 siblings, 2 replies; 5+ messages in thread
From: Jens Remus @ 2023-12-08 16:03 UTC (permalink / raw)
  To: binutils; +Cc: Jens Remus, Andreas Krebbel, Nick Clifton

With this patch series the s390 disassembler optionally prints the
instruction descriptions as comment in the disassembly. This is enabled
by specifying the new s390-specific disassembler option "insndesc".

Patch 1 is a cleanup in the s390-mkopc build, that I stumbled upon.

Patch 2 allows to optionally print the instruction descriptions as
comments using s390-specific disassembler option "insndesc".

Example output:
$ objdump -d -M insndesc test
...
0000000000000620 <deregister_tm_clones>:
 620:   c0 10 00 00 0d 5c       larl    %r1,20d8 <__TMC_END__>  # load address relative long
 626:   c0 20 00 00 0d 59       larl    %r2,20d8 <__TMC_END__>  # load address relative long
 62c:   ec 12 00 0a 80 64       cgrje   %r1,%r2,640 <deregister_tm_clones+0x20> # compare and branch relative (64)
 632:   c4 18 00 00 0c d7       lgrl    %r1,1fe0 <_ITM_deregisterTMCloneTable@Base>     # load relative long (64)
 638:   ec 18 00 04 00 7c       cgije   %r1,0,640 <deregister_tm_clones+0x20>   # compare immediate and branch relative (64<8)
 63e:   07 f1                   br      %r1     # unconditional branch
 640:   07 fe                   br      %r14    # unconditional branch

Note that the readability can be enhanced by using a filter such as "expand":

$ objdump -d -M insndesc test | expand -t 8,16,24,32,40,80
...
0000000000000620 <deregister_tm_clones>:
 620:   c0 10 00 00 0d 5c       larl    %r1,20d8 <__TMC_END__>                  # load address relative long
 626:   c0 20 00 00 0d 59       larl    %r2,20d8 <__TMC_END__>                  # load address relative long
 62c:   ec 12 00 0a 80 64       cgrje   %r1,%r2,640 <deregister_tm_clones+0x20> # compare and branch relative (64)
 632:   c4 18 00 00 0c d7       lgrl    %r1,1fe0 <_ITM_deregisterTMCloneTable@Base> # load relative long (64)
 638:   ec 18 00 04 00 7c       cgije   %r1,0,640 <deregister_tm_clones+0x20>   # compare immediate and branch relative (64<8)
 63e:   07 f1                   br      %r1                                     # unconditional branch
 640:   07 fe                   br      %r14                                    # unconditional branch

Regards,
Jens

Jens Remus (2):
  s390: Fix build when using EXEEXT_FOR_BUILD
  s390: Optionally print instruction description in disassembly

 binutils/NEWS         |  5 ++++
 include/opcode/s390.h |  5 +++-
 opcodes/Makefile.am   |  7 +++--
 opcodes/Makefile.in   |  7 +++--
 opcodes/s390-dis.c    | 13 ++++++++-
 opcodes/s390-mkopc.c  | 18 ++++++++-----
 opcodes/s390-opc.c    | 62 +++++++++++++++++++++----------------------
 7 files changed, 73 insertions(+), 44 deletions(-)

-- 
2.40.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-12-11 11:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-08 16:03 [PATCH 0/2] s390: Optionally print instruction description in disassembly Jens Remus
2023-12-08 16:03 ` [PATCH 1/2] s390: Fix build when using EXEEXT_FOR_BUILD Jens Remus
2023-12-11 11:48   ` Nick Clifton
2023-12-08 16:03 ` [PATCH 2/2] s390: Optionally print instruction description in disassembly Jens Remus
2023-12-11 11:52   ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).