K1实现了IME扩展的相关指令,如何查询该规范中每条指令的格式
比如vmadot指令的opcode,func3,func7的值
https://github.com/space-mit/riscv-ime-extension-spec
这个仓库中的信息不太完整
K1实现了IME扩展的相关指令,如何查询该规范中每条指令的格式
比如vmadot指令的opcode,func3,func7的值
https://github.com/space-mit/riscv-ime-extension-spec
这个仓库中的信息不太完整
可以在这里Release The first version of SpacemiT IME extension spec. · space-mit/riscv-ime-extension-spec · GitHub 下载PDF,在第19页查看
The spec explicitly states:
NOTE: This extension instructions only support cases where LMUL is less than or equal to 1.
However, the vmadot-gemm-demo.c uses LMUL=2 for the accumulator:
vsetvli t0, zero, e32, m2 // LMUL=2 - VIOLATES SPEC!
This violates the IME specification’s LMUL ≤ 1 constraint.
The demo executable runs successfully on the native Spacemit RISC-V machine, producing correct results that match the reference implementation. This suggests:
The vmadot-gemm-4x8x4 executable ran successfully on native Spacemit hardware:
Test successful. CRef equal to C.
Both reference (nested loops) and vmadot-accelerated implementations produced identical results, confirming correct operation of the 4×4×8 MAC unit with VLEN=256, SEW=8.
A modified version using LMUL=1 was created (vmadot-gemm-demo-lmul1.c) and tested:
Key Changes:
vsetvli t0, zero, e32, m2 to vsetvli t0, zero, e32, m1vxor.vv v28, v28, v28
vxor.vv v29, v29, v29
vse32.v v28, (%[C])
addi %[C], %[C], 32
vse32.v v29, (%[C])
Test Results:
Test successful. CRef equal to C.
Comparison:
Both LMUL=2 and LMUL=1 versions produce identical results. The LMUL=1 version:
The native Spacemit RISC-V machine supports both LMUL=1 and LMUL=2 approaches:
Both approaches work correctly and produce identical results. The LMUL=1 approach is the recommended method for spec compliance.