s390: Fix disassembly of optional addressing operands

"nop D1(B1)" erroneously disassembled into "nop D1(B1" (missing
closing parenthesis).  "nop D1(X1,0)" and "nop D1(X1,)" erroneously
disassembled into "nop D1(X1)" (missing zero base register) instead
of "nop D1(X1,0)".

Do not skip disassembly of optional operands if they are index (X)
or base (B) registers or length (L) in an addressing operand sequence
"D(X,B)",  "D(B)", or "D(L,B).  Index and base register operand values
of zero are being handled separately, as they may not be omitted
unconditionally.  For instance a base register value of zero must be
printed in above mentioned case, to distinguish the index from the
base register.  This also ensures proper formatting of addressing
operand sequences.

While at it add further test cases for instructions with optional
operands.

opcodes/
	* s390-dis.c (s390_print_insn_with_opcode): Do not
	unconditionally skip disassembly of optional operands with a
	value of zero, if within an addressing operand sequence.

gas/testsuite/
	* gas/s390/zarch-optargs.d: Add further test cases for
	instructions with optional operands.
	* gas/s390/zarch-optargs.s: Likewise.

Reported-by: Florian Krohm <flo2030@eich-krohm.de>
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
3 files changed