4 ms·
"ARM has a Javascript instruction" is just misinformed. They have always had the FCVTZS instruction which converts a floating point number to an integer (just
by brucehoult 6y ago
"ARM has a Javascript instruction" is just misinformed.
They have always had the FCVTZS instruction which converts a floating point number to an integer (just as every instruction set has). If the floating point number is too large to fit in an integer then the bottom 32 bits are returned.
The new(ish) FJCVTZS does exactly the same operation except that if the floating point number it too large then the largest integer is always returned.
The implementation complexity difference is just about zero. It just so happens that the new instruction fits what JavaScript wants while the old one fits what C wants.
There is certainly nothing non-RISC about FJCVTZS. It's a perfectly simple instruction.