'Polyfill vmlaq_lane_f32 for Webassembly
Webassembly doesn't currently support FMA instructions and vmlaq_lane_f32 fails to compile with Emscripten. So far I came up with the code below but there's no such thing as vaddq_lane_f32 and vaddq_f32 works on all lanes so it's not the best solution.
float32x4_t vmlaq_lane_f32(float32x4_t a, float32x4_t b, float32x4_t c, lane) {
return vaddq_f32(a, vmulq_lane_f32(b, vget_low_f32(c), lane));
}
Second issue is lane must be const and the above doesn't work as a standalone function so I have to replace every instance manually.
One more problem is that multiple files should include this definition and the compiler errors out due to redefinition in o. files.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
