← Back to context

Comment by delifue

3 days ago

ARM already have a special instruction `FJCVTZS` to accelerate JavaScript. If WebAssembly gets popular enough there will probably be hardware acceleration for it.

https://community.arm.com/arm-community-blogs/b/architecture...

https://stackoverflow.com/questions/50966676/why-do-arm-chip...

JavaScript is in the name, but really it's just a way to convert floats to ints with the kind of rounding that x86 does. The impetus might've been to run JS faster because JS specifies x86 semantics, but it's not like it's some wild "JavaScript acceleration instruction". I don't really get why they put JavaScript in the name to be honest.

Except FJCVTZS is not exclusively useful to javascript. Its behaviour is that of x86 rounding, which is what the JS spec encodes. So it’s also useful for x86 emulation / compatibility in general.

> If WebAssembly gets popular enough there will probably be hardware acceleration for it.

ARM already tried that back in the days with Jazelle. Plus much of the point of WASM is that you can compile it to machine code during loading.