|
|
|
|
|
by codedokode
1103 days ago
|
|
> Modern processors can retire multiple additions per cycle. Then add multiple overflow checking units. > one of them has a throughput of 4/cycle and the other one will be 3/cycle and compiler authors will pick the former every time. Currently on RISC-V checked addition requires 4 dependent instructions, so its throughput is about 1 addition/cycle. |
|
You can't.
With your favoured ISA style you can't just put 4 or 8 checked overflow add instructions in a row and run them all in parallel because they all write to the same condition code flag. You have to put conditional branches between them.
Or, if you want an overflowing add to trap then you can't do anything critical in the following instructions until you know whether the first one traps or not e.g. if the instructions are like "add r1,(r0)+; add r2,(r0)+; add r3,(r0)+; add r4,(r0)+". In this example you can't write back the updated r0 value until you know whether the instruction traps of not. Even worse if you reverse the operands and have a RMW instruction.