3 ms·
In other words, two more instructions, instead of zero. That compilers fail to do clever masking tricks to avoid branches frequently results in 2x slower progr
by ncmncm 7y ago
In other words, two more instructions, instead of zero.
That compilers fail to do clever masking tricks to avoid branches frequently results in 2x slower programs.
- avianes 7y agoNo, as jleahy said, it cost a single instruction to transform 0 to 0b00..00 and 1 to 0b11..11 - SUB X, $0, X. And your proposal - using the zero register as a flag register - breaks way more micro-optimizations (like the simple ones described in "The RISC-V Reader" book) than it allows