public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: yulong <shiyulong@iscas.ac.cn>
To: Palmer Dabbelt <palmer@dabbelt.com>, jeffreyalaw@gmail.com
Cc: libc-alpha@sourceware.org, Darius Rad <darius@bluespec.com>,
	Andrew Waterman <andrew@sifive.com>,
	maskray@google.com, kito.cheng@sifive.com, wuwei2016@iscas.ac.cn,
	jiawei@iscas.ac.cn, shihua@iscas.ac.cn, chenyixuan@iscas.ac.cn
Subject: Re: [RFC V4] Enable libmvec support for RISC-V
Date: Fri, 10 May 2024 21:06:10 +0800	[thread overview]
Message-ID: <f30c6081-b3aa-491e-bf26-6edea63f8337@iscas.ac.cn> (raw)
In-Reply-To: <mhng-64516cc8-c628-4b9c-8924-5a1fa1875765@palmer-ri-x1c9a>

[-- Attachment #1: Type: text/plain, Size: 3435 bytes --]


在 2024/5/1 0:26, Palmer Dabbelt 写道:
> On Wed, 24 Apr 2024 22:07:31 PDT (-0700), jeffreyalaw@gmail.com wrote:
>>
>>
>> On 4/15/24 1:21 AM, shiyulong@iscas.ac.cn wrote:
>>> From: yulong <shiyulong@iscas.ac.cn>
>>>
>>> Diff: Chande the version from GLIBC_2.39 to GLIBC_2.40.
>>> This patch tries to enable libmvec on RISC-V. I also have demonstrated
>>> how this all fits together by adding implementations for vector cos.
>>> This patch is a try and we hope to receive valuable comments.
>> Just an FYI -- Palmer's team over at Rivos have implementations for a
>> number of routines that would fit into libmvec.  You might reach out to
>> Ping Tak Peter Tang <ptpt@rivosinc.com> for information in his
>> implementation.
>>
>>> https://github.com/rivosinc/veclibm/
>>
>>
>> THeir implementations may provide good guidance on performant
>> implementations of various routines that libmvec typically provides.
>
> Ya, that's the idea of veclibm.  The actual functions are written in a 
> way that's more suitable for some other libraries, but the core 
> computational implemenations should be the same.  A few of us had 
> briefly talked internally about getting these into glibc, IIUC all the 
> code was written at Rivos and thus could be copyright assigned to the 
> FSF and used in glibc.  We don't have time to do that right now, but 
> if you're interested in helping that'd be awesome.  We'll need to be 
> careful with the copyright/licensing, though.
Thanks for your reply.   I also received an email from Peter Tang. I am 
very interested in contributing to glibc.
>
> That said, I've never really quite managed to figure out how all the 
> libmvec stuff is supposed to fit together.  I'm more worried about the 
> ABI side of things than the implementation, so I think starting with 
> just one function to get the ABI template figure out is a reasonable 
> way to go and we can get the rest of the implementations ported over 
> next.  The first thing that jumps out on the ABI side of things is 
> cos() taking EMUL=2 types, I'm not sure if there's a reason for that 
> but it seems we'd want EMUL=1 to fit more data in the argument registers?
Setting EMUL=2 is just a personal experiment. I think you are right and 
I will improve it in the next version.
>
> Also, I think some of this can be split out: the 
> roundtoint/converttoint isn't really a libmvec thing (see 
> https://inbox.sourceware.org/libc-alpha/20220803174258.4235-1-palmer@rivosinc.com/, 
> which fails some test), and ptr_barrier() can probably be pulled out 
> to something generic as it's the same as arm64's version.
>
> I'm also only seeing draft versions of the vector intrinsics.  I know 
> we merged them into GCC and usually that means things are stable, but 
> we merged these pre-freeze (based on some assertions things wouldn't 
> change) and things have drifted around a bit it the spec.  I think 
> we're probably safe just depending on the types, if there's no frozen 
> version we should at least write down exactly which version we're 
> following though.
We are currently developing based on the latest branches. Can we declare 
that we are following RVV 1.0?
>
> Also: are there GCC patches for these?  It'd be great to be able to 
> test things through the whole codegen stack so we can make sure it works.
Unfortunately, there are no patches for GCC right now. This may be the 
direction of future work.
>
>>
>> jeff

      reply	other threads:[~2024-05-10 13:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15  7:21 shiyulong
2024-04-25  5:07 ` Jeff Law
2024-04-29  1:12   ` yulong
2024-04-30 16:26   ` Palmer Dabbelt
2024-05-10 13:06     ` yulong [this message]

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=f30c6081-b3aa-491e-bf26-6edea63f8337@iscas.ac.cn \
    --to=shiyulong@iscas.ac.cn \
    --cc=andrew@sifive.com \
    --cc=chenyixuan@iscas.ac.cn \
    --cc=darius@bluespec.com \
    --cc=jeffreyalaw@gmail.com \
    --cc=jiawei@iscas.ac.cn \
    --cc=kito.cheng@sifive.com \
    --cc=libc-alpha@sourceware.org \
    --cc=maskray@google.com \
    --cc=palmer@dabbelt.com \
    --cc=shihua@iscas.ac.cn \
    --cc=wuwei2016@iscas.ac.cn \
    /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).