public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Peter Bergner <bergner@linux.ibm.com>
To: Dmitry Selyutin <ghostmansd@gmail.com>, Alan Modra <amodra@gmail.com>
Cc: Luke Kenneth Casson Leighton <lkcl@lkcl.net>,
	lkcl <luke.leighton@gmail.com>,
	binutils@sourceware.org
Subject: Re: Plugin-based opcode table
Date: Sat, 28 May 2022 21:30:18 -0500	[thread overview]
Message-ID: <17f6beb2-db1a-0bec-b022-168373c3921b@linux.ibm.com> (raw)
In-Reply-To: <CAMqzjeuUagZ3e0_uPWzopJBveUX9E6gDwu9KAOxbX_nrpibBhQ@mail.gmail.com>

On 5/23/22 8:06 AM, Dmitry Selyutin via Binutils wrote:
> On Mon, May 23, 2022 at 3:59 PM Alan Modra <amodra@gmail.com> wrote:
>> I don't see any need for the artificial boundaries you might get with
>> a plugin, whatever that might look like.  ppc-opc.c already supports
>> multiple incompatible powerpc cpu implementations, including ones that
>> depart significantly from current powerpc ISA documentation.
> 
> Alan, please, correct me if I'm wrong: does it mean that we can just
> stick to marking new instructions and facilities with a custom per-CPU
> flag? For now I introduced the -mlibresoc CPU which enabled the
> PPC_OPCODE_SVP64 flag, and marked some new instructions appropriately
> with this flag. Would that be OK if we follow this approach?

I'm just catching up on my email backlog after being on vacation last
week, but I agree with everything Alan said and also agree with how
you're going about things.

That said, I assume your -mlibresoc flag enables more than just the
PPC_OPCODE_SVP64 flag, since there is a lot of "base" POWER instructions
like addi, etc. that I'm sure your cpu implements.  If for some reason,
one of those "base" instructions enabled by -mlibresoc isn't implemented
by your cpu or conflicts in some way with your new instructions, you
can add the PPC_OPCODE_SVP64 to the deprecated field for the problematic
instruction to disable it when using -mlibresoc.

For example, POWER9 uses all the flags POWER8 enables plus PPC_OPCODE_POWER9.
However, the "lxvx" instruction changed between POWER8 (where it was an
extended mnemonic for lxvd2x) and POWER9 where is became a real instruction
with a different opcode than lxvd2x (I'm ignoring that doing that was
a very bad idea!).  How that was solved, was adding PPC_OPCODE_POWER9
to the old lxvx instruction's deprecated field to disable that on POWER9
and later cpus.  POWER9 and later cpus get the new lxvx instruction,
because we enable it with the PPC_OPCODE_POWER9.

Peter


  parent reply	other threads:[~2022-05-29  2:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 12:37 Dmitry Selyutin
2022-05-17 14:01 ` lkcl
2022-05-23 12:59   ` Alan Modra
2022-05-23 13:06     ` Dmitry Selyutin
2022-05-24  5:41       ` Alan Modra
2022-05-24 22:11         ` Dmitry Selyutin
2022-05-29  2:30       ` Peter Bergner [this message]
2022-05-29  9:13         ` Luke Kenneth Casson Leighton
2022-05-30 23:55           ` Paul Mackerras
2022-05-31  4:06             ` lkcl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17f6beb2-db1a-0bec-b022-168373c3921b@linux.ibm.com \
    --to=bergner@linux.ibm.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=ghostmansd@gmail.com \
    --cc=lkcl@lkcl.net \
    --cc=luke.leighton@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).