]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - binutils/NEWS
s390: Print base register 0 as "0" in disassembly
authorJens Remus <jremus@linux.ibm.com>
Fri, 1 Mar 2024 11:45:14 +0000 (12:45 +0100)
committerJens Remus <jremus@linux.ibm.com>
Fri, 1 Mar 2024 11:45:14 +0000 (12:45 +0100)
commit75a28d1a97ace81c8481fd1c85d21e6f22e68924
treead764109e3f3fa1a0228078d50c6e35210589286
parentdfa4ac9728ce8999a9b53d1ef37b175380940ee5
s390: Print base register 0 as "0" in disassembly

Base and index register 0 have no effect in address computation:

"A value of zero in the B [base] or X [index] field specifies that no
base or index is to be applied, and, thus, general register 0 cannot be
designated as containing a base address or index."
IBM z/Architecture Principles of Operation [1], chapter "Organization",
section "General Registers".

Index register 0 is omitted in the s390 disassembly. Base register 0 is
omitted in D(B), D(L,B) and D(X,B) - the latter only if the index
register is zero.

To make it more apparent print base register 0 as "0" instead of "%r0",
whenever it would still be printed in the disassembly.

[1]: IBM z/Architecture Principles of Operation, SA22-7832-13,
     https://publibfp.dhe.ibm.com/epubs/pdf/a227832d.pdf

opcodes/
* s390-dis.c: Print base register 0 as "0" in disassembly.

binutils/
* NEWS: Mention base register 0 now being printed as "0" in s390
disassembly.

gas/
* testsuite/gas/s390/zarch-base-index-0.d: Update test case
output verification patterns to accept "0" as base base
register due to disassembler output format change.
* gas/testsuite/gas/s390/zarch-omitted-base-index.d: Likewise.

Reviewed-by: Andreas Krebbel <krebbel@linux.ibm.com>
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
binutils/NEWS
gas/testsuite/gas/s390/zarch-base-index-0.d
gas/testsuite/gas/s390/zarch-omitted-base-index.d
opcodes/s390-dis.c