-
-
Save bnjbvr/e268b2eba1f6dc32b4ec to your computer and use it in GitHub Desktop.
SIMD example for padenot
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
if (window.SIMD) { | |
// yay, SIMD available, let's do a little stereo mixdown routine | |
for (var i = 0; i < bufsize; i+=4) { | |
var lhs = SIMD.float32x4(left[i+0], left[i+1], | |
left[i+2], left[i+3]), | |
rhs = SIMD.float32x4(right[i+0], right[i+1], | |
right[i+2], right[i+3]); | |
var mixdown = SIMD.float32x4.add(lhs, rhs); | |
SIMD.float32x4.store(center, i, mixdown); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment