Add a WASM SIMD128 2x2 CGEMM microkernel - #5985
Open
jjerphan wants to merge 1 commit into
Open
Conversation
jjerphan
force-pushed
the
wasm128-cgemm
branch
from
August 20, 2026 13:12
232881c to
778224c
Compare
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #5983 / #5680 / #4023: replace the scalar packed 2×2 CGEMM/ZGEMM kernel used by
WASM128_GENERICwith a WASM SIMD128 microkernel.CGEMMKERNEL/ZGEMMKERNELnow usekernel/wasm/zgemmkernel_2x2_wasm128.c. The main 2×2 tile isf32x4/f64x2complex mul for all four conjugate patterns; remainders stay scalar. Packing stayszgemm_{n,t}copy_2.kernel/wasm/KERNELwrapsCGEMMKERNEL/ZGEMMKERNEL(and their copy objects) inifndefsoKERNEL.WASM128_GENERICis not overwritten — the same include-order fix as TRMM/GEMM in Add a 4x4 WASM SIMD128 GEMM microkernel #5983.Benchmarks
Node / Emscripten,
TARGET=WASM128_GENERIC,USE_THREAD=0,COMMON_OPT=-O2. Same machine, 5 warmup + 10 timed samples (median). Speedup > 1 means this branch is faster thandevelop.Geomean vs
develop: CGEMM 1.51x, ZGEMM 1.53x, CHEMM 1.52x, ZHEMM 1.52x. SGEMM/DGEMM unchanged within noise.Test plan
utestunder node (106/106)ctestL1/L2/L3 (x{s,d,c,z}cblat{1,2,3}) under node, including CGEMM/ZGEMM and CHEMM/ZHEMM