3 ms·
> No it doesn’t, it’s still surprising to see a CPU instruction added specifically to cater for such a high level language like JS. It surprises you personally
by barumi 6y ago
> No it doesn’t, it’s still surprising to see a CPU instruction added specifically to cater for such a high level language like JS.
It surprises you personally, but if you think about it it's easy to understand that widespread interpreters that use a specific number crunching primitive implented in software can and do benefit from significant performance improvements if they offload that to the hardware.
You only need to browse through the list of opcodes supported by modern processors to notice a countless list of similar cases of instructions being added to support even higher-leve operations.
I mean, are you aware that even Intel added instructions for signal processing, graphics, and even support for hash algorithms?
And you're surprised by a floating point rounding operation?
- moritzwarhier 6y agoConsidering that JS is JIT-compiled and doesn't have an integer type, this is not suprising to me at all.. (but still interesting)