2 ms·
> paying for the checks on every operation whether or not you need it the actual overflow check is just the carry out... it's pretty cheap. putting it in a fla
by nullc 6y ago
> paying for the checks on every operation whether or not you need it
the actual overflow check is just the carry out... it's pretty cheap. putting it in a flags register creates dependencies. But there are presumably other approaches possible-- optional trapping, additional bits per output register, etc.
- Taniwha 6y agoStatus flags are a bit of a nightmare if you're building a massively superscalar implementation, every instruction has an explicit dependency on the one before - there have been a bunch of different solutions which often cost instruction decode space. RISC-V says "usually we don't care, let's only take the cost when we really need it" which is a very RISCish sort of thing to do. For those who haven't dabbled RISC-V has compare-and-branch instructions rather than branch on condition instructions
- jabl 6y agoDoesn't arm have another set of arithmetic instructions that don't update the flags register, to avoid the dependency when it's not needed?