public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>,
	Palmer Dabbelt <palmer@rivosinc.com>
Cc: Evan Green <evan@rivosinc.com>,
	libc-alpha@sourceware.org, slewis@rivosinc.com,
	Vineet Gupta <vineetg@rivosinc.com>
Subject: Re: [PATCH v2 0/3] RISC-V: ifunced memcpy using new kernel hwprobe interface
Date: Fri, 31 Mar 2023 14:19:19 -0600	[thread overview]
Message-ID: <44f66aa6-346f-99c7-0a9c-de9fa0bcd490@gmail.com> (raw)
In-Reply-To: <71550310-e6ef-dfa1-db3b-dcd7407fd413@linaro.org>



On 3/31/23 13:32, Adhemerval Zanella Netto wrote:
> 
> It is still not clear to me what RISCV, as ABI and not as an specific vendor,
> wants to provide arch and vendor specific str* and mem* routines.  Christophe
> has hinted that the focus is not compile-only approach, so I take --with-cpu
> support (similar to what some old ABI used to provide, like powerpc) is not
> an option.  However, this is not what the RVV proposal does [3], which is to
> enable RVV iff you target glibc to rvv (so compile-only).
I believe there is consensus on the desire to use dynamic dispatch via 
an ifunc resolver.




> 
> And that's why I asked you guys to first define on how you want to approach
> it.
I think that's already done.  I don't really see any confusion in this 
space.

The patch from the sifive team has static dispatch, they made it clear 
they want dynamic dispatch though.  Static dispatch is just a stopgap 
until the dynamic dispatch work is ready AFAICT.

rivos had a dynamic dispatch mechanism based on riscv_hwprobe

VRULL had a dynamic dispatch based on an environment variable.  This was 
acknowledged to be a hack which would be dropped once the kernel->glibc 
interface bits were sorted out.

Ventana doesn't have patches in this space, but had been using the VRULL 
bits.  I don't really have a preference as far as implementations.  I 
just want to define good ones that cover the most important cases, 
particularly with regard to ISA extensions, but I'm even willing to 
narrow the immediate focus down further (see below).


> 
> So I take that RISCV want to follow what x86_64 and aarch64 do, which is
> provide optimized routines for a minimum abi (say rv64gc), and then provide
> runtime selection through ifunc for either ABI or vendor specific routines
> (including variant like the unaligned optimization).

Right.  That's basically what I think we're trying to do.  Find a 
suitable implementation we can agree upon for a given ISA architecture. 
The belief right now is that we need one for the baseline architecture, 
one for architectures implementing ZBB and another for architectures 
that implement RVV.  ZBB and RVV are not uarch variants; they are 
standardized, but optional ISA features.

I don't think anyone is (yet!) pushing for uarch variants.  In fact, I 
would very much like to avoid that as much as I can.  Palmer might see 
uarch variants are inevitable, I don't (and maybe I'm being naive).




   You can still follow
> what x86_64 and s390 recently did, which is if you define a minimum ABI
> version, you default the optimized version and either skip ifunc selection
> or setup a more restrict set (so in future, you can have a rvv-only build
> that does not need to provide old zbb or rv64gc support).
I'm focused on defining a implementation for the baseline architecture 
as well as one for ZBB and RVV ISAs.


> 
> Which then leads to how to actually test and provide such support.  The
> str* and mem* tests consult which ifunc variant are support
> (ifunc-impl-list.c) on the underlying hardware; while the selector returns
> the best option.  Both rely on how to query the hardware at or least which
> version are supported, so I think RISCV should first figure out this part
> (unless you do want to follow the compile-only approach...)

> 
> So it does not make sense to me to have ifunc variants not selected or
> tested in repo, only to be enabled in a foreseen future.
I think this is the core point we disagree on.   I understand your 
position, respectfully disagree, but I'm willing to set it aside.

So perhaps we can narrow down the scope right now even further.  Can we 
agree to try and settle on a base implementation with no ISA extensions 
and no uarch variants?  ISTM if we can settle on those implementations 
that it should be usable immediately by the RV community at large and 
doesn't depend on the kernel->glibc interface work.


Jeff


  reply	other threads:[~2023-03-31 20:19 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21 19:15 Evan Green
2023-02-21 19:15 ` [PATCH v2 1/3] riscv: Add Linux hwprobe syscall support Evan Green
2023-03-29 18:38   ` Adhemerval Zanella Netto
2023-02-21 19:15 ` [PATCH v2 2/3] riscv: Add hwprobe vdso call support Evan Green
2023-03-29 18:39   ` Adhemerval Zanella Netto
2023-02-21 19:15 ` [PATCH v2 3/3] riscv: Add and use alignment-ignorant memcpy Evan Green
2023-03-28 22:54 ` [PATCH v2 0/3] RISC-V: ifunced memcpy using new kernel hwprobe interface Palmer Dabbelt
2023-03-28 23:41   ` Adhemerval Zanella Netto
2023-03-29  0:01     ` Palmer Dabbelt
2023-03-29 19:16       ` Adhemerval Zanella Netto
2023-03-29 19:45         ` Palmer Dabbelt
2023-03-29 20:13           ` Adhemerval Zanella Netto
2023-03-30 18:31             ` Evan Green
2023-03-30 19:43               ` Adhemerval Zanella Netto
2023-03-30  6:20           ` Jeff Law
2023-03-30 18:43             ` Evan Green
2023-03-31  5:09               ` Jeff Law
2023-03-30 19:38             ` Adhemerval Zanella Netto
2023-03-31 18:07               ` Jeff Law
2023-03-31 18:34                 ` Palmer Dabbelt
2023-03-31 19:32                   ` Adhemerval Zanella Netto
2023-03-31 20:19                     ` Jeff Law [this message]
2023-03-31 21:03                       ` Palmer Dabbelt
2023-03-31 21:35                         ` Jeff Law
2023-03-31 21:38                           ` Palmer Dabbelt
2023-03-31 22:10                             ` Jeff Law
2023-04-07 15:36                               ` Palmer Dabbelt

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=44f66aa6-346f-99c7-0a9c-de9fa0bcd490@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=evan@rivosinc.com \
    --cc=libc-alpha@sourceware.org \
    --cc=palmer@rivosinc.com \
    --cc=slewis@rivosinc.com \
    --cc=vineetg@rivosinc.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).