nx_simd_vdot_test.nx
buildroot/runtime/nx_simd_vdot_test.nx
about
nx_simd_vdot_test.nx -- widening dot product i16x16 -> i64.
The kernel of every ML inference inner loop, every convolution
stride, every audio/DSP filter on x86. vpmaddwd does (a*b)
pair-wise into 8 i32 lanes in ONE instruction; RV-V does it via
vwmul.vv + vwredsum.vs (widening at the codegen layer).
We test the bit-exact behaviour vs a hand-written scalar reduce
because the widening prevents intermediate overflow that the
naive vmul+vreduce_sum would suffer with values > 181 (since
181*181 = 32761 ~ INT16_MAX).
dependencies 2 imports · 0 importers
imports: nx_kernel_v2.nxnx_log.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 17 | func pack4_i16(a: i64, b: i64, c: i64, d: i64) -> i64 |
| 25 | func sx_i16(x: i64) -> i64 called by 1: ref_dot |
| 32 | func ref_dot(a: *i64, b: *i64) -> i64 |
| 47 | func t1_identity_dot() -> i64 |
| 71 | func t2_large_values_no_overflow() -> i64 |
| 93 | func t3_mixed_sign() -> i64 |
| 119 | func t4_zero_vector() -> i64 |
| 136 | func main() -> nx_exit |