-
Notifications
You must be signed in to change notification settings - Fork 9
Description
(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 to rv64,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 environment QEMU_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* and Zk*) are not supported on 7.0.0 yet though, so -march=rv64gcv_zba_zbb_zbc_zbs and QEMU_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 add vext_spec=v1.0 like rv64,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