16 Commits
Author SHA1 Message Date
Julien Jerphanion b47183a713 Add WASM SIMD128 SGEMV/DGEMV kernels
kernel/wasm/KERNEL is included after KERNEL.WASM128_GENERIC and
unconditionally pointed S/D GEMV at RISC-V scalar gemv_{n,t}.c, so a
target-file SIMD kernel would never run.

Add kernel/wasm/gemv_{n,t}.c for both precisions. GEMV_T keeps 8
(float) / 4 (double) independent column accumulators with IEEE mul+add
and delays the horizontal add until after the inner loop. GEMV_N
streams four columns into y with a four-lane v128 unroll. Non-unit
stride stays scalar (no WASM gather/scatter).

Guard SGEMV{N,T}KERNEL/DGEMV{N,T}KERNEL with ifndef in KERNEL so the
target file wins. CGEMV/ZGEMV stay RISC-V scalar.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2026-08-21 16:18:59 +02:00
Martin Kroeker 6d36cf6b9b Merge pull request #5984 from jjerphan/wasm128-axpy
Add a WASM SIMD128 SAXPY/DAXPY kernel
2026-08-20 20:22:42 +02:00
Martin Kroeker 0f74330773 Merge pull request #5985 from jjerphan/wasm128-cgemm
Add a WASM SIMD128 2x2 CGEMM microkernel
2026-08-20 20:21:13 +02:00
Julien Jerphanion 778224cee2 Add a WASM SIMD128 2x2 CGEMM microkernel
Vectorize the packed 2x2 CGEMM/ZGEMM inner loop with f32x4/f64x2
complex mul. Do not let kernel/wasm/KERNEL override the target
kernel the way 4x4 real GEMM already guards TRMM.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2026-08-20 15:13:10 +02:00
Julien Jerphanion 459624cec2 Add a WASM SIMD128 4x4 DTRMM microkernel
Generic scalar DTRMM was the remaining Level-3 gap (~15 GFLOPS vs
~23 DGEMM). Keep SIMD for double only; single-precision TRMM already
auto-vectorized and a shared S+D kernel slowed SGEMM.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2026-08-20 14:57:36 +02:00
Julien Jerphanion 12e3e23654 Add a WASM SIMD128 SAXPY/DAXPY kernel
kernel/wasm/KERNEL is included after KERNEL.WASM128_GENERIC and
unconditionally pointed S/D AXPY at RISC-V scalar axpy.c, so the
x86_64 V_SIMD sources listed in the target file never ran.

Add kernel/wasm/axpy.c for both precisions. Unit-stride y += da * x
uses eight independent v128 lanes (32 floats / 16 doubles) with IEEE
mul+add; remainder is one vector then scalar. Skip relaxed madd:
AXPY is checked to machine epsilon, and putting it in the generic
V_SIMD path previously slowed Level 1. Non-unit stride stays scalar
(no WASM gather); inc==0 uses that path so y[0] += n * da * x[0].

Guard SAXPYKERNEL/DAXPYKERNEL with ifndef in KERNEL so the target
file wins. CAXPY/ZAXPY stay RISC-V scalar.

On n=512..8192 vs the RISC-V champion, SAXPY is about 1.4–3.0x and
DAXPY about 1.4–2.2x. test.sh is green.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2026-08-20 09:17:30 +02:00
Julien Jerphanion 2ed3ca3940 wasm: add a 4x4 SIMD128 GEMM microkernel for SGEMM/DGEMM
Switch WASM128_GENERIC to unroll 4 with matching ncopy/tcopy and TRMM
4x4 so packing width stays consistent. Use relaxed SIMD madd in the
inner loop when compiled with -mrelaxed-simd.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2026-08-19 14:17:22 +02:00
Julien Jerphanion 0fb0441220 wasm: gate TRSM call counters behind OPENBLAS_WASM_TRSM_PROFILE
Keep production STRSM/DTRSM free of always-on increments; enable the
counters only when counting invocations.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2026-08-19 14:16:28 +02:00
teddygood ecca5e480d Add WASM128_GENERIC STRSM and DTRSM kernels 2026-04-16 17:52:37 +09:00
teddygood 2847354ffb Allow target-specific GEMM and TRSM overrides 2026-04-16 17:52:37 +09:00
teddygood 6f672df537 Use generic DDOT kernel for WASM128_GENERIC 2026-03-19 14:15:32 +09:00
teddygood 6bb0dbfd3c Use generic SDOT kernel for WASM128_GENERIC 2026-03-19 13:54:58 +09:00
teddygood 99d05575d0 Enable SAXPY for WebAssembly SIMD backend 2026-03-18 21:27:45 +09:00
teddygood 86d1451cbe Add WebAssembly SIMD GEMM kernels 2026-03-17 05:51:54 +09:00
Martin Kroeker 48f0a0f0ec Generate WASM kernel including existing intrinsics-based kernels 2026-03-15 19:28:08 +01:00
Martin Kroeker cc64ce68c3 Create generic C KERNEL as baseline for WASM 2026-03-15 19:26:42 +01:00