How to enable RVV intrinsics in gcc?

1,396 views
Skip to first unread message

Bruce Hoult

unread,
Sep 13, 2022, 7:27:48 PM9/13/22
to RISC-V SW Dev
I've got a fresh build of the most recent commit of master in riscv-collab/riscv-gnu-toolchain and am happily using RVV in assembly language e.g.


I wanted to rewrite my assembly language function using RVV intrinsics, following the examples in ...


... but the compiler can't find riscv_vector.h and neither can I.

Is that still the way to do it? Are intrinsics merged into master? How do you enable it?

I see the rvv-intrinsic branch was merged into __archive__ on May 9 and then deleted.

I understand that auto-vectorisation etc work is happening in llvm not gcc, but we can use intrinsics in gcc, yes?

Tommy Murphy

unread,
Sep 13, 2022, 8:16:14 PM9/13/22
to Bruce Hoult, RISC-V SW Dev
... but the compiler can't find riscv_vector.h and neither can I.

I can see it here in case that's of any use?


Are you sure that you're building the RVV enabled toolchain correctly? Maybe this is relevant?


Bruce Hoult

unread,
Sep 13, 2022, 8:37:06 PM9/13/22
to Tommy Murphy, RISC-V SW Dev
Well, I'm not sure, that's why I'm asking.   I'm following the normal instructions in the README.md, but there is no mention of vectors anywhere. I'm just doing ./configure --enable-multilib --prefix=<dir>; make as usual, and RVV flags are accepted by gcc and passed through to the assembler and RVV instructions are accepted and work.

So the answer is that intrinsics are NOT merged into master yet, three years after we wrote them, and I need the rvv-next branch? OK, that's all I wanted to know. Cheers.


--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/LO0P265MB686617BBBBA3970ABA30B81CF9469%40LO0P265MB6866.GBRP265.PROD.OUTLOOK.COM.

Tommy Murphy

unread,
Sep 14, 2022, 2:44:41 AM9/14/22
to Bruce Hoult, RISC-V SW Dev
I got the impression from the issue that I linked that you have to clone the master branch of riscv-gnu-toolchain and then overlay the riscv-rvv-next branch over gcc-tools only in order to build the RVV toolchain?

Reply all
Reply to author
Forward
0 new messages