Floating point denormal flush-to-zero - possible in wasm32?

Hi,

I'm working on audio applications, where it's not uncommon to encounter subnormal float numbers (i.e. in filters).

On certain architectures, i.e. x86_64 with SSE, it's possible to activate Flush-To-Zero, to automatically set these to zero.

Is there a way to achieve the same thing on wasm32, or do I have to do it manually?

Best,
N

https://github.com/rust-lang/rfcs/pull/3514 hasn't been approved yet but afaik modifying the float environment including FTZ behavior has always been UB. So this kind of code has to be written in assembly or C with #pragma fenv_access until a better way is found.

See also #123123

So, hardware platforms aside, there's no way to do it for WebAssembly targets at the current moment? I've read some discussions around it in the WASM design repo, but it didn't seem very recent.

At the moment, no. See also design/FutureFeatures.md at main · WebAssembly/design · GitHub and design/Semantics.md at main · WebAssembly/design · GitHub

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.