Closed WojciechMula closed 7 months ago
@aswaterman rebased
The output from sample program https://github.com/WojciechMula/toys/tree/master/detect-rvv:
~/github/toys/detect-rvv$ make && spike --isa=rv64gc `which pk` ./detect
make: 'detect' is up to date.
RISCV_HWPROBE_KEY_IMA_EXT_0:
- RISCV_HWPROBE_IMA_C
key 0xffffffffffffffff: value 0x0000000000000000
~/github/toys/detect-rvv$ make && spike --isa=rv64gcv `which pk` ./detect
make: 'detect' is up to date.
RISCV_HWPROBE_KEY_IMA_EXT_0:
- RISCV_HWPROBE_IMA_C
- RISCV_HWPROBE_IMA_V
key 0xffffffffffffffff: value 0x0000000000000000
Thank you!
See: https://www.kernel.org/doc/html/latest/arch/riscv/hwprobe.html
Please note that there is just a partial support, as I aimed to dynamic detection of the V extension. TBH I'm not 100% happy with solution, as I feel like we should use
mstatus
rather thanmisa
. Appreciate any feedback.