]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
s390: Treat addressing operand sequence as one in disassembler
authorJens Remus <jremus@linux.ibm.com>
Fri, 29 Nov 2024 14:37:19 +0000 (15:37 +0100)
committerJens Remus <jremus@linux.ibm.com>
Fri, 29 Nov 2024 14:37:19 +0000 (15:37 +0100)
commit36bbf8646c8b885ddb1a7e617e85fb29bead6f53
tree3a75beb4dd46e7f93410ad452d4c3d8654105d66
parent453f481aabf6b552dc83dc63c4f62ed2a6b41ded
s390: Treat addressing operand sequence as one in disassembler

Reuse logic introduced with the preceding commit in the assembler to
treat addressing operand sequences D(X,B), D(B), and D(L,B) as one
with regards to optional last operands (i.e. optparm and optparm2).

With this "nop" now disassembles into "nop" instead of "nop 0".

opcodes/
* s390-dis.c (operand_count): New helper to count the remaining
operands, treating D(X,B), D(B), and D(L,B) as one.
(skip_optargs_p): New helper to test whether remaining operands
 are optional.
(skip_optargs_zero_p): New helper to test whether remaining
operands are optional and their values are zero.
(s390_print_insn_with_opcode): Use skip_optargs_zero_p to skip
optional last operands with a value of zero.

gas/testsuite/
* gas/s390/zarch-optargs.d (nop): Adjust test case accordingly.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
gas/testsuite/gas/s390/zarch-optargs.d
opcodes/s390-dis.c