[0/6] s390: Add missing extended mnemonics

Message ID 20231120140635.3642601-1-jremus@linux.ibm.com
Headers
Series s390: Add missing extended mnemonics |

Message

Jens Remus Nov. 20, 2023, 2:06 p.m. UTC
  This patch series adds the following extended mnemonics (grouped by
function) to the s390 target architecture:
- jc, jcth
- lfi, llgfi, llghi
- notr, notgr
- risbhgz, risblgz
- rnsbgt, rosbgt, rxsbgt

Additionally the patch series aligns the definition of optional last
operands to the specification in the z/Architecture Principles of
Operation. Option optparm is added to the following existing (extended)
mnemonics:
- risbg, risbgz, risbgn, risbgnz
- risbhg, risblg
- rnsbg, rosbg, rxsbg

Patches 1-3 are preparatory changes. Patch 4 aligns the optional operand
definition. Patch 5 adds the missing extended mnemonics. Patch 6 corrects
an instruction name.

Patch 1 implements an enhancement to use regular expressions with back
references to validate the disassembly of instructions with relative
addressing. This removes the need to update most relative addresses in
the golden master files the disassembly is checked against when
inserting new tests.

Patch 3 enhances the definition of the operand indices, so that new
operands can be inserted into the operand table without having to
renumber any indices. This minimizes future hunks that insert new
operands, such as those introduced by patch 5.

Thanks and regards,
Jens

Jens Remus (6):
  s390: Position independent verification of relative addressing
  s390: Add brasl edge test cases from ESA to z/Architecture
  s390: Make operand table indices relative to each other
  s390: Align optional operand definition to specs
  s390: Add missing extended mnemonics
  s390: Correct prno instruction name

 gas/config/tc-s390.c                  |  12 +-
 gas/testsuite/gas/s390/esa-g5.d       | 105 +++++-----
 gas/testsuite/gas/s390/esa-g5.s       |   1 +
 gas/testsuite/gas/s390/esa-z900.d     |  96 ++++-----
 gas/testsuite/gas/s390/zarch-arch13.d |   4 +
 gas/testsuite/gas/s390/zarch-arch13.s |   4 +
 gas/testsuite/gas/s390/zarch-z10.d    | 272 ++++++++++++++------------
 gas/testsuite/gas/s390/zarch-z10.s    |  18 ++
 gas/testsuite/gas/s390/zarch-z196.d   |  14 +-
 gas/testsuite/gas/s390/zarch-z196.s   |  11 ++
 gas/testsuite/gas/s390/zarch-z9-109.d |   2 +
 gas/testsuite/gas/s390/zarch-z9-109.s |   2 +
 gas/testsuite/gas/s390/zarch-z900.d   |  19 +-
 gas/testsuite/gas/s390/zarch-z900.s   |   7 +
 gas/testsuite/gas/s390/zarch-zEC12.d  |  24 ++-
 gas/testsuite/gas/s390/zarch-zEC12.s  |   3 +
 opcodes/s390-opc.c                    | 190 ++++++++++--------
 opcodes/s390-opc.txt                  |  36 +++-
 18 files changed, 474 insertions(+), 346 deletions(-)
  

Comments

Nick Clifton Nov. 22, 2023, 12:13 p.m. UTC | #1
Hi Jens,

> This patch series adds the following extended mnemonics (grouped by
> function) to the s390 target architecture:
> - jc, jcth
> - lfi, llgfi, llghi
> - notr, notgr
> - risbhgz, risblgz
> - rnsbgt, rosbgt, rxsbgt
> 
> Additionally the patch series aligns the definition of optional last
> operands to the specification in the z/Architecture Principles of
> Operation. Option optparm is added to the following existing (extended)
> mnemonics:
> - risbg, risbgz, risbgn, risbgnz
> - risbhg, risblg
> - rnsbg, rosbg, rxsbg
> 
> Patches 1-3 are preparatory changes. Patch 4 aligns the optional operand
> definition. Patch 5 adds the missing extended mnemonics. Patch 6 corrects
> an instruction name.
> 
> Patch 1 implements an enhancement to use regular expressions with back
> references to validate the disassembly of instructions with relative
> addressing. This removes the need to update most relative addresses in
> the golden master files the disassembly is checked against when
> inserting new tests.
> 
> Patch 3 enhances the definition of the operand indices, so that new
> operands can be inserted into the operand table without having to
> renumber any indices. This minimizes future hunks that insert new
> operands, such as those introduced by patch 5.

Patch series approved - please apply.

Do these new instructions have a name to cover them as a whole ?
I am thinking that it would be nice to have an entry in the gas/NEWS
file that says something like "add support for the XXX extension to the
s390x architecture".

One other, minor thing.  I tried to look at the documentation that
you referenced in patch 5:

 > Add extended mnemonics specified in the z/Architecture Principles of
 > Operation [1] and z/Architecture Reference Summary [2], that were
 > previously missing from the opcode table.

 > [1] IBM z/Architecture Principles of Operation, SA22-7832-13,
 >    https://www.ibm.com/support/pages/zarchitecture-principles-operation
 > [2] IBM z/Architecture Reference Summary, SA22-7871-11,
 >    https://www.ibm.com/support/pages/zarchitecture-reference-summary

I found that link [2] diverts to a "500: Internal Server Error" page
and link [1] would not let me download the document without first
registering for an IBMid, which I can do, but it is not really Open
Source friendly...

Cheers
   Nick
  
Jens Remus Nov. 22, 2023, 4:25 p.m. UTC | #2
Hello Nick,

Am 22.11.2023 um 13:13 schrieb Nick Clifton:
>> This patch series adds the following extended mnemonics (grouped by
>> function) to the s390 target architecture:
>> - jc, jcth
>> - lfi, llgfi, llghi
>> - notr, notgr
>> - risbhgz, risblgz
>> - rnsbgt, rosbgt, rxsbgt

...

>> Patches 1-3 are preparatory changes. Patch 4 aligns the optional operand
>> definition. Patch 5 adds the missing extended mnemonics. Patch 6 corrects
>> an instruction name.

...

> Patch series approved - please apply.

Thanks! Andreas will take care.

> Do these new instructions have a name to cover them as a whole ?
> I am thinking that it would be nice to have an entry in the gas/NEWS
> file that says something like "add support for the XXX extension to the
> s390x architecture".

No, these extended mnemonics were simply missed to be added over time. I 
did a cross check against the latest version of the IBM z/Architecture 
Principles of Operation specification to identify them.

Extended mnemonics are purely syntactic sugar and actually assemble into 
a base mnemonic. The identical instruction could be coded by using the 
existing base mnemonic instead of the new extended mnemonic. The 
disassembler for s390 tries to disassemble into the extended mnemonic, 
if it is not a simple alias, which makes the disassembly more human 
readable.

> One other, minor thing.  I tried to look at the documentation that
> you referenced in patch 5:
> 
>  > Add extended mnemonics specified in the z/Architecture Principles of
>  > Operation [1] and z/Architecture Reference Summary [2], that were
>  > previously missing from the opcode table.
> 
>  > [1] IBM z/Architecture Principles of Operation, SA22-7832-13,
>  >    https://www.ibm.com/support/pages/zarchitecture-principles-operation
>  > [2] IBM z/Architecture Reference Summary, SA22-7871-11,
>  >    https://www.ibm.com/support/pages/zarchitecture-reference-summary
> 
> I found that link [2] diverts to a "500: Internal Server Error" page
> and link [1] would not let me download the document without first
> registering for an IBMid, which I can do, but it is not really Open
> Source friendly...

Thanks for the hint! I have sent a V2 of my patches 3 and 4 with direct 
links to the documentation. These should work without an IBMid.

Regards,
Jens
  
Andreas Krebbel Nov. 23, 2023, 2:53 p.m. UTC | #3
On 11/22/23 17:25, Jens Remus wrote:
> Hello Nick,
> 
> Am 22.11.2023 um 13:13 schrieb Nick Clifton:
>>> This patch series adds the following extended mnemonics (grouped by
>>> function) to the s390 target architecture:
>>> - jc, jcth
>>> - lfi, llgfi, llghi
>>> - notr, notgr
>>> - risbhgz, risblgz
>>> - rnsbgt, rosbgt, rxsbgt
> 
> ...
> 
>>> Patches 1-3 are preparatory changes. Patch 4 aligns the optional operand
>>> definition. Patch 5 adds the missing extended mnemonics. Patch 6 corrects
>>> an instruction name.
> 
> ...
> 
>> Patch series approved - please apply.
> 
> Thanks! Andreas will take care.

Committed to mainline. Thanks!

Andreas