-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add extra extensions to RISC-V #218
Comments
What's the QEMU version on the runner host? The changelog says that QEMU supports the ratified vector extension starting from 7.0 only, so if we're going to go vectors we probably need to get at least 7.0 on the host: https://wiki.qemu.org/ChangeLog/7.0#RISC-V. 7.1 would be better because it will also add, as said, the crypto extensions: https://wiki.qemu.org/ChangeLog/7.1#RISC-V |
The current version should be 6.x (6.23?). https://packages.ubuntu.com/focal/qemu-user-static |
Maybe we can use https://github.com/multiarch/qemu-user-static to get 7.1. |
I'll install qemu-user-static 7.1 from .deb like codewars/riscv#9 |
Deployed |
Thanks! I've tried it on a few kata and it works great |
(Moved from: #199 (comment))
Can we get some extra extensions like vector, bit-manipulation and scalar crypto enabled? It seems that for user-mode emulation setting
QEMU_CPU
torv64,v=on
etc would do the trick, though it does require a sort of recent version of QEMU, and I'm not sure what's the minimum required and what's the version on the runner. I've tested on QEMU 7.1.0/7.0.0 and GCC 11.3.0.I roughly checked https://gitlab.com/qemu-project/qemu/-/blob/master/target/riscv/cpu.c and it seems that passing argument
-march=rv64gcv_zba_zbb_zbc_zbs_zbkx_zk_zks
to GCC and environmentQEMU_CPU=rv64,v=on,zbkx=on,zk=on,zks=on
to QEMU should enable everything that QEMU supports.Though it seems that the crypto ones (
Zbk*
andZk*
) are not supported on 7.0.0 yet though, so-march=rv64gcv_zba_zbb_zbc_zbs
andQEMU_CPU=rv64,v=on
would be a great start (Zb*
are enabled on QEMU by default). In addition, on QEMU 7.1.0, it complains with a warning unless you addvext_spec=v1.0
likerv64,v=on,vext_spec=v1.0
, so that's something to keep in mind.I've written a kumite that should work (at least compile fine (at least should fail with a different message)) if the changes above are implemented: https://www.codewars.com/kumite/635ac4a48f20014af2cf522e
The text was updated successfully, but these errors were encountered: