public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: lkcl <luke.leighton@gmail.com>
To: Dmitry Selyutin <ghostmansd@gmail.com>
Cc: Binutils <binutils@sourceware.org>, Alan Modra <amodra@gmail.com>,
	 Jan Beulich <jbeulich@suse.com>,
	Nick Alcock <nick.alcock@oracle.com>,
	 Richard Earnshaw <Richard.Earnshaw@foss.arm.com>,
	Andreas Schwab <schwab@linux-m68k.org>,
	 Libre-Soc General Development
	<libre-soc-dev@lists.libre-soc.org>
Subject: Draft Simple-V roadmap for Power ISA (was: [PATCH v3 0/6] ppc/svp64: support SVP64 and its first insns)
Date: Fri, 24 Jun 2022 12:38:39 +0100	[thread overview]
Message-ID: <CAPweEDyc1z_S1-MXEZNqcAPxL8uu7nFD_wa=pyyV0RK53u3kmg@mail.gmail.com> (raw)
In-Reply-To: <CAMqzjevGfYdMBi81cSEMQrHMR6wc1KcTLk_yc=kyw2_R1QF-aA@mail.gmail.com>

On Thu, Jun 23, 2022 at 8:46 PM Dmitry Selyutin <ghostmansd@gmail.com> wrote:

> Hi folks, many thanks for your tips, suggestions and ideas on
> improvements!

it's greatly appreciated, everyone, you as well, Dmitry.

just so everyone knows, the bulk of the work for binutils, adding
Draft Cray-style Scalable Vectors to the Power ISA is, astoundingly,
pretty much done.

there are *NO* actual Vector instructions in SV. we will NOT be
submitting 200-5,000 Vector opcodes as would normally be done
in any other Scalable Vector ISA: ppc64-opc.c contains the
*entirety* of the Vector "contextualisation" of *pre-existing* Scalar
instructions [9]

context and roadmap:

* Simple-V is named "simple" because it adheres to a strict
  RISC paradigm [extended into the Scalable Vector space]
* there are only 5 actual "management" instructions:
   setvl, svstep, svremap, svshape, svindex (TODO [0])
   these last three are for hardware-controlled "Structure Packing"
   such as Matrices and other Dimensional shuffling, and
   full triple-loop DCT/FFT (normally only found in VLIW DSPs)
* there is "borrowing" of 25% of the EXT001 64-bit prefix
   space which gives 24 bits to "categorise" every Scalar
   instruction, according to their register profile [1]

as new *Scalar* instructions get added to the Power ISA,
then if it is appropriate to do so [8] they would correspondingly
have to be run through  the "register profile analysis" [2] and,
for sanity's sake, the ppc64-opc.[ch] auto-generator re-run [3].

now, we *also* happen to be developing some Scalar instructions.
it's really important to emphasise that these have absolutely nothing
to do with SV, at all.

these Scalar instructions are designed to bring the Scalar Power
ISA up-to-date in many areas outside of its primary focus and perfectly
reasonable and understandable use-case to date [IBM's high-end
customers]. example: i'm currently designing a bitmanip-mask instruction
which covers the entirety of BMI and TBM [4] *and* RVV's vsbfm suite.
none of these were needed for any IBM workloads / customers so
it is perfectly reasonable that they were never considered.

there's also a pair of biginteger math operations, a variant of
the intel "mulx" instruction is one of them [5].  the majority
of the list is on the bitmanip page [6], these will take some
time simply because there's a lot of them (appx... 80-100)

still on the TODO list:

* macro support (including the "8" of element-width=8, sorry Dmitry!) [7]
* svindex for doing vector-looped GPR[RT] = GPR(GPR(RA)) [0]
* submit scalar instructions [6] and corresponding ppc64-opc.[ch] [2][3]

that's basically it.  there's no binutils-level subsetting of SVP64 because
the lower SV Compliancy Levels require soft-emulation through illegal
instruction traps.  there's no Vector instructions to add: everything
Scalable-Vectorised is in the 24-bit Prefix.

overall, then, the strict RISC paradigm creates one hell of a lot less
work for everyone, yet brings something mind-melting like 2 million
intrinsics to the Power ISA. which is only manageable by sticking
strictly to RISC principles.

l.

[0] https://bugs.libre-soc.org/show_bug.cgi?id=867

[1] fascinatingly this approach was exactly the one that Peter Hsu
     and his team at MIPS, when they were developing the R8000,
     came up with around 1995.

[2] https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/sv/sv_analysis.py;hb=HEAD
[3] https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/sv/sv_binutils.py;hb=HEAD

[4] https://bugs.libre-soc.org/show_bug.cgi?id=865#c1

[5] https://libre-soc.org/openpower/sv/biginteger/

[6] https://libre-soc.org/openpower/sv/bitmanip/

[7] https://bugs.libre-soc.org/show_bug.cgi?id=849

[8] new Scalar instructions have to make sense in a Vector context
     "scalar===element" before they can be Prefixed to extend to multiple
    elements. mtmsr doesn't qualify for example because there's only
    ever going to be one MSR.  sc makes no sense, but weirdly td/tw
    tdi/twi do.

[9] we tried breaking the rule of adding Vector opcodes without having
     the corresponding identical Scalar instruction: it went very badly.
     lesson learned.

  parent reply	other threads:[~2022-06-24 11:38 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-17 19:08 [PATCH 0/5] ppc/svp64: support SVP64 and its first insns Dmitry Selyutin
2022-06-17 19:08 ` [PATCH 1/5] svp64: support LibreSOC architecture Dmitry Selyutin
2022-06-17 19:08 ` [PATCH 2/5] ppc/svp64: support setvl instructions Dmitry Selyutin
2022-06-17 19:08 ` [PATCH 3/5] ppc/svp64: support svstep instructions Dmitry Selyutin
2022-06-17 19:08 ` [PATCH 4/5] ppc/svp64: support svshape instruction Dmitry Selyutin
2022-06-19 23:49 ` [PATCH 0/5] ppc/svp64: support SVP64 and its first insns Alan Modra
2022-06-21 11:55   ` Dmitry Selyutin
2022-06-21 11:51 ` [PATCH v2 " Dmitry Selyutin
2022-06-21 11:51   ` [PATCH v2 1/5] ppc/svp64: support LibreSOC architecture Dmitry Selyutin
2022-06-21 11:51   ` [PATCH v2 2/5] ppc/svp64: support setvl instructions Dmitry Selyutin
2022-06-21 18:25     ` Peter Bergner
2022-06-21 18:39       ` Peter Bergner
2022-06-21 11:51   ` [PATCH v2 3/5] ppc/svp64: support svstep instructions Dmitry Selyutin
2022-06-21 11:51   ` [PATCH v2 4/5] ppc/svp64: support svshape instruction Dmitry Selyutin
2022-06-22  6:41   ` [PATCH v2 0/5] ppc/svp64: support SVP64 and its first insns Jan Beulich
2022-06-22  6:44   ` Jan Beulich
2022-06-22  6:57     ` Dmitry Selyutin
2022-06-23 19:37   ` [PATCH v3 0/6] " Dmitry Selyutin
2022-06-23 19:37     ` [PATCH v3 1/6] ppc/svp64: support LibreSOC architecture Dmitry Selyutin
2022-06-23 19:37     ` [PATCH v3 2/6] ppc: introduce non-zero operand Dmitry Selyutin
2022-06-23 19:58       ` lkcl
2022-06-23 19:37     ` [PATCH v3 3/6] ppc/svp64: support setvl instructions Dmitry Selyutin
2022-06-23 19:37     ` [PATCH v3 4/6] ppc/svp64: support svstep instructions Dmitry Selyutin
2022-06-23 19:37     ` [PATCH v3 5/6] ppc/svp64: support svshape instruction Dmitry Selyutin
2022-06-23 19:37     ` [PATCH v3 6/6] ppc/svp64: support svremap instruction Dmitry Selyutin
2022-06-23 19:45     ` [PATCH v3 0/6] ppc/svp64: support SVP64 and its first insns Dmitry Selyutin
2022-06-23 20:10       ` Dmitry Selyutin
2022-06-24 11:38       ` lkcl [this message]
2022-06-23 20:08     ` [PATCH v4 " Dmitry Selyutin
2022-06-23 20:08       ` [PATCH v4 1/6] ppc/svp64: support LibreSOC architecture Dmitry Selyutin
2022-06-23 20:08       ` [PATCH v4 2/6] ppc: introduce non-zero operand flag Dmitry Selyutin
2022-06-23 20:08       ` [PATCH v4 3/6] ppc/svp64: support setvl instructions Dmitry Selyutin
2022-06-23 20:08       ` [PATCH v4 4/6] ppc/svp64: support svstep instructions Dmitry Selyutin
2022-06-23 20:08       ` [PATCH v4 5/6] ppc/svp64: support svshape instruction Dmitry Selyutin
2022-06-23 20:08       ` [PATCH v4 6/6] ppc/svp64: support svremap instruction Dmitry Selyutin
2022-06-26 18:59       ` [PATCH v5 0/7] ppc/svp64: support SVP64 and its first insns Dmitry Selyutin
2022-06-26 18:59         ` [PATCH v5 1/7] ppc/svp64: support LibreSOC architecture Dmitry Selyutin
2022-06-26 19:00         ` [PATCH v5 2/7] ppc: introduce non-zero operand flag Dmitry Selyutin
2022-06-26 19:00         ` [PATCH v5 3/7] ppc/svp64: support setvl instructions Dmitry Selyutin
2022-06-26 19:00         ` [PATCH v5 4/7] ppc/svp64: support svstep instructions Dmitry Selyutin
2022-06-26 19:00         ` [PATCH v5 5/7] ppc/svp64: support svshape instruction Dmitry Selyutin
2022-06-26 19:00         ` [PATCH v5 6/7] ppc/svp64: support svremap instruction Dmitry Selyutin
2022-06-26 19:00         ` [PATCH v5 7/7] ppc/svp64: support svindex instruction Dmitry Selyutin
2022-07-25 13:10         ` [PATCH v6 0/7] ppc/svp64: support SVP64 and its first insns Dmitry Selyutin
2022-07-25 13:10           ` [PATCH v6 1/7] ppc/svp64: support LibreSOC architecture Dmitry Selyutin
2022-07-25 13:10           ` [PATCH v6 2/7] ppc: introduce non-zero operand flag Dmitry Selyutin
2022-07-25 13:10           ` [PATCH v6 3/7] ppc/svp64: support setvl instructions Dmitry Selyutin
2022-08-15  6:18             ` Jan Beulich
2022-08-15 12:58               ` lkcl
2022-08-15 13:08                 ` Dmitry Selyutin
2022-08-21 14:53                 ` Jan Beulich
2022-08-21 16:04                   ` lkcl
2022-07-25 13:10           ` [PATCH v6 4/7] ppc/svp64: support svstep instructions Dmitry Selyutin
2022-07-25 13:10           ` [PATCH v6 5/7] ppc/svp64: support svshape instruction Dmitry Selyutin
2022-07-25 13:10           ` [PATCH v6 6/7] ppc/svp64: support svremap instruction Dmitry Selyutin
2022-07-25 13:10           ` [PATCH v6 7/7] ppc/svp64: support svindex instruction Dmitry Selyutin
2022-07-26 13:14           ` [PATCH v6 0/7] ppc/svp64: support SVP64 and its first insns Dmitry Selyutin
2022-07-27  4:53             ` Alan Modra
2022-07-27  6:38               ` lkcl
2022-08-11  9:14           ` Alan Modra
2022-08-11 10:48             ` [PATCH 0/5] " lkcl
2022-08-12  3:30             ` [PATCH v6 0/7] " Dmitry Selyutin

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='CAPweEDyc1z_S1-MXEZNqcAPxL8uu7nFD_wa=pyyV0RK53u3kmg@mail.gmail.com' \
    --to=luke.leighton@gmail.com \
    --cc=Richard.Earnshaw@foss.arm.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=ghostmansd@gmail.com \
    --cc=jbeulich@suse.com \
    --cc=libre-soc-dev@lists.libre-soc.org \
    --cc=nick.alcock@oracle.com \
    --cc=schwab@linux-m68k.org \
    /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).