Mercurial
comparison third_party/emsdk/bazel/hello-world/hello-world-simd.cc @ 179:8d17f6e6e290
[ThirdParty] Added emsdk bazel rules that can be supported by bazel 9.0.0
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Thu, 22 Jan 2026 21:23:17 -0800 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 178:94705b5986b3 | 179:8d17f6e6e290 |
|---|---|
| 1 #include <wasm_simd128.h> | |
| 2 | |
| 3 void multiply_arrays(int* out, int* in_a, int* in_b, int size) { | |
| 4 for (int i = 0; i < size; i += 4) { | |
| 5 v128_t a = wasm_v128_load(&in_a[i]); | |
| 6 v128_t b = wasm_v128_load(&in_b[i]); | |
| 7 v128_t prod = wasm_i32x4_mul(a, b); | |
| 8 wasm_v128_store(&out[i], prod); | |
| 9 } | |
| 10 } |