Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report rvv bug (missing vsetvli) in upstream gcc and remove workaround #52

Open
PhilippvK opened this issue Jul 2, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed toolchain:gcc

Comments

@PhilippvK
Copy link
Member

According to the RVV spec, it the job of the compiler (LLVM, GCC) to insert appropriate vsetvli if vtype changes between operations: https://github.com/riscv-non-isa/rvv-intrinsic-doc/blob/c783839de5a59480d09f1a9b69257fca4096434e/archive/rvv-intrinsic-rfc.md#sew-and-lmul-of-intrinsics

LLVM seems to do this all the time, but the version of the RISC-V gcc we use (13.2) seems to be generating invalid programs sometimes, causing spike to crash.

We had to make the vl volatile here to prevent GCC from breaking this kernel.
See here:

volatile size_t vl = vsetvl_e16m4(loop_count);

We should figure it if this got already patched upstream and whether the workaround can be dropped. If we need to keep it, we should remove the volatile and instead add the missing vsetvli in an #if __GNUC__ >= 13...

@PhilippvK PhilippvK self-assigned this Jul 2, 2024
@PhilippvK PhilippvK added bug Something isn't working help wanted Extra attention is needed toolchain:gcc labels Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed toolchain:gcc
Projects
None yet
Development

No branches or pull requests

1 participant