s390: Add support for three optional operands in dis-/assembly
Enhances s390 assembler and disassembler to handle instructions with up to three optional operands.
The s390 assembler and disassembler now support instructions with up to three optional trailing operands, crucial for VRR variants like VRR-a and VRR-c. This update also fixes an issue where omitted trailing optional operands with constant bits were not correctly handled during disassembly. A new function, s390_extract_operand_masked, is introduced to manage constant operand bits for both omission testing and printing.
In Details
This commit extends s390 instruction format support to include up to three optional trailing operands, enabling assembly and disassembly for instruction formats like VRR-a and VRR-c. It introduces S390_INSTR_FLAG_OPTPARM3 and refactors operand handling in tc-s390.c and s390-dis.c. A new helper s390_extract_operand_masked is added to correctly handle masking of constant bits in unsigned immediate operands during disassembly, fixing a prior limitation to single optional operands.
- optional operands
- Operands in an instruction format that are not required and can be omitted if certain conditions are met or if default values are implied.
- disassembly
- The process of converting machine code back into assembly language.
- instruction format
- A template defining the structure and fields of a machine instruction.
- VRR
- A class of s390 instruction formats involving Register-to-Register operations.