4 ms·
Not necessarily programming languages (in similar vain as what est31 said) but cryptography has made its way into instructions, see SHA1RNDS4, SHA1NEXTE, SHA1MS
by diggan 6y ago
Not necessarily programming languages (in similar vain as what est31 said) but cryptography has made its way into instructions, see SHA1RNDS4, SHA1NEXTE, SHA1MSG1 and more. They are not general cryptographic primitives but specific instructions for computing a specific cryptographic hash, just because SHA became popular. Also has SHA in it's name :)
- est31 6y agoYes, the examples I quoted AES and CRC all have dedicated instructions in x86 processors (at least the ones that implement the extensions). https://en.wikipedia.org/wiki/AES_instruction_set#Instructions https://en.wikipedia.org/wiki/AES_instruction_set#Instructio... https://www.felixcloutier.com/x86/crc32 https://www.felixcloutier.com/x86/crc32 As does ARM: https://developer.arm.com/documentation/ddi0514/g/introduction/about-the-cortex-a57-processor-cryptography-engine https://developer.arm.com/documentation/ddi0514/g/introducti... https://developer.arm.com/documentation/dui0801/g/A32-and-T32-Instructions/CRC32 https://developer.arm.com/documentation/dui0801/g/A32-and-T3... You could say that these are language-agnostic, and indeed they are, but in a certain way they are more specific than the JavaScript operation, because the JavaScript operation is likely used in many different algorithms. I'd argue that from the point of view of a chip manufacturer, the difference matters only little. Both are tasks that the CPUs do often and thus cost energy. By implementing them natively, the CPU manufacturer reduces the cost of those workflows for their clients.
- neerajsi 6y agoMore importantly, the customers of the cpu vendors use benchmarks to evaluate potential chip suppliers, and Js benchmarks are near the top of the list for ARM now. Everyone from the OS vendor to the compiler authors to ARM itself are looking at the same operations, so instructions like this get requested and added. There are also funny xaflag, axflag instructions in armv8 specifically to speed up x86 emulation on arm64. I believe they were added at the request of the msft emulator team.