4 ms·
Well, it has one: FJCVTZS Floating-point Javascript Convert to Signed fixed-point, rounding toward Zero.
by CalChris 5y ago
Well, it has one: FJCVTZS Floating-point Javascript Convert to Signed fixed-point, rounding toward Zero.
- goldenkey 5y agoI thought you were kidding and then I looked it up: https://developer.arm.com/documentation/dui0801/latest/A64-Floating-point-Instructions/FJCVTZS https://developer.arm.com/documentation/dui0801/latest/A64-F... Seems kind of gross to me to have such a language specific instruction to be honest.
- olliej 5y agoIt’s actually “convert float to int the way x86 does it because js specified that behavior”
- olliej 5y agoIt’s simply matching the c86 float to int conversion, because JS specifies that behavior in the spec - all this instruction does is even the playing field it isn’t some magic instruction that does more than x86 does. At a logic level there are no changes to the expensive part of rounding, only changes to the overflow values in the result.