Skip to content

Instantly share code, notes, and snippets.

View GavinRay97's full-sized avatar

Gavin Ray GavinRay97

View GitHub Profile
@GavinRay97
GavinRay97 / jsfx_dotprod.c
Created March 15, 2021 23:57 — forked from ess7/jsfx_dotprod.c
JSFX extension: dot product
// params: y0, y1, interleaved x, coeff, n
static EEL_F NSEEL_CGEN_CALL dotprod2(void *opaque, INT_PTR np, EEL_F **parms) {
EEL_F **blocks = (EEL_F **)opaque;
int xofs = *parms[2];
int cofs = *parms[3];
int n = *parms[4];
*parms[0] = 0.0;
*parms[1] = 0.0;
if (unlikely(n <= 0 || xofs < 0 || cofs < 0 ||