Created attachment 127 [details] example implementation in C Arm v8.3A added an instruction for accelerating JavaScript's ToInt32 operation. OpenPower could also benefit from adding something like that too, since the required operation can be easily implemented in hardware but there isn't any existing instruction sequence that can as efficiently implement that in software, since the existing instructions all saturate (iirc) instead of wrapping. http://lists.libre-soc.org/pipermail/libre-soc-dev/2021-March/002055.html http://lists.libre-soc.org/pipermail/libre-soc-dev/2021-March/002064.html Example implementation in C: https://gcc.godbolt.org/z/4KPxxh