4 ms·
Instruction fusion still means lower code density. You can go overboard, but the newer ARM instruction set(s) are pretty good.
by vardump 1y ago
Instruction fusion still means lower code density. You can go overboard, but the newer ARM instruction set(s) are pretty good.
- Findecanor 1y agoNot necessarily lower density. On ARM you would often need cmp and csel, which are two instructions, eight bytes. RISC-V has cmp-and-branch in a single instruction, which with c.mv normally makes six bytes. If the cmp-and-branch instruction tests one of x8..x15 against zero then that could also be a compressed instruction: making four bytes in total.
- astrange 1y agoARMv8.7 added some new instructions for int min/max to replace cmp+csel. (I'm surprised it took them so long to add popcnt.) https://www.corsix.org/content/arm-cssc https://www.corsix.org/content/arm-cssc
- sylware 1y agoCompressed instruction only matter for niche (and even in such niche, nowadays, I guess it is very probably very questionable), here you would not use compressed instructions, just the right instruction pattern for fusion, like div/rem.
- duskwuff 1y agoAs an aside: it's only relevant on microcontrollers nowadays, but ARM T32 (Thumb) code density is really good. Most instructions are 2 bytes, and it's got some clever ways to represent commonly used 32-bit values in 12 bits: https://developer.arm.com/documentation/ddi0403/d/Application-Level-Architecture/The-Thumb-Instruction-Set-Encoding/32-bit-Thumb-instruction-encoding/Modified-immediate-constants-in-Thumb-instructions https://developer.arm.com/documentation/ddi0403/d/Applicatio...
- wren6991 1y agoRISC-V code density is pretty good these days with Zcmp (push, pop, compressed double move) and Zcb (compressed mul, sign/zero-extend, byte load/store). There is also Zcmt but it's kind of cursed. Hopefully density will keep improving once mainstream compilers have full support for Zilsd/Zclsd (load/store pair for RV32). T32 is a pretty good encoding but far from perfect. If they had the chance to redo it I doubt they would spend a full 1/32nd of the encoding space on asrs, for example.
- sylware 1y agoRISC-V instructions are pretty good, without any IP lock like ARM or x86_64.