Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

[Quick Question] How to access the vector registers from .insn custom instruction directive? #367

Open
NazerkeT opened this issue Feb 3, 2023 · 1 comment

Comments

@NazerkeT
Copy link

NazerkeT commented Feb 3, 2023

Hey everyone!

I was trying to add a new custom instruction to RISC-V Vector extension and using this directive for my earlier codes to test the tools:

asm __volatile__ (".insn r 0x6b, 0x0, 0x00, %0, %1, a1\n" : "=r"(a) : "r"(b) );

However, when I want to use v1 register instead of the a1, compiler says that I am using illegal operands. I guess the issue comes from using smth else instead of r after .insn. But atm, I cannot find info about that, can you please help with what I have to change in my inline assembly here?

I am using this command to run my application:

/opt/riscv-vector/bin/riscv64-unknown-elf-gcc -march=rv64gcv vec-mod.c

@angsch
Copy link

angsch commented May 16, 2023

Better a late answer than no answer: Clobbering of vector registers such as v1 is currently not supported. kito-cheng answered in #365 that GCC 13 should support the usage of inline assembly with vector registers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants