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

RISC-V: exploit -mrvv-vector-bits=zvl when used #526

Open
sh1boot opened this issue Mar 4, 2024 · 1 comment
Open

RISC-V: exploit -mrvv-vector-bits=zvl when used #526

sh1boot opened this issue Mar 4, 2024 · 1 comment

Comments

@sh1boot
Copy link
Contributor

sh1boot commented Mar 4, 2024

Here CONFIG=1 defaults to a run-time determination of the hardware vector length:

#define SLEEF_RVV_VLEN __riscv_vlenb()

If the symbol __riscv_v_fixed_vlen is defined then the compiler is generating code which supports only that specified vector length (measured in bits), and we can lean into this by using the compile-time macro instead of the intrinsic call.

I have patches outstanding which edit this code, but they don't implement this suggestion. To make the change requires a bunch of extra CI permutations to test with and without -mrvv-vector-bits=zvl so it's not as trivial as it sounds.

CC: @luhenry

I don't expect a drastic performance gain, but it might help a little.

@luhenry
Copy link
Contributor

luhenry commented Mar 4, 2024

-mrvv-vector-bits= should be the exception especially for the distribution of a binary/library as it would then be tied to whatever it was compiled for. Unless it's a functional requirement, or it's known that the binary is going to target a single class/model of hardware, then it's more pain than gain.

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

No branches or pull requests

2 participants