Hacker News new | ask | show | jobs
by simonh 2053 days ago
The special CPU instruction for JS thing is a bit silly. Javascript defines it's floating point rounding behaviour as what Intel CPUs do. ARM behaves differently by default, so they implemented an instruction to emulate the Intel behaviour specially to avoid Javascript running too slowly implementing the excepted behaviour in code.

This doesn't give ARM chips an advantage over Intel CPUs at executing Javascript for obvious reasons, once you know why they added it.

2 comments

> This doesn't give ARM chips an advantage over Intel CPUs at executing Javascript for obvious reasons, once you know why they added it.

I believe the point is that it's one example (of hundreds, maybe thousands?) of performance paper-cuts addressed by Apple hardware that result in significant performance-per-watt advantages over devices not using Intel CPUs.

And it effectively just sets the FPU flags, runs the instruction, then resets the FPU flags. It just avoids the JS VM from having change FPU flags repeatedly.