Quick, and perhaps silly question, but here it is nevertheless. Writing to a register immediately after reading from it may cause a hazard if if we try to write to a register before its value could be fetched by the previous instruction. Does the following instruction then cause a hazard on an ARM chip:
add r3, r0, r3
which essentially is r3 += r0?
Will this be a hazard on NEON? Ex:
vadd.32 q3, q0, q3
There is no WAR hazard.
The destination register is not needed before the source registers are; the requirement that
r3be available for reading as an input is at least as strong as the requirement that it be available for writing to. In short, there’s no reason to avoid this construct.