Hardware-level micro-op optimization
Hardware-level micro-op optimization
Posted Jul 12, 2018 23:44 UTC (Thu) by ncm (guest, #165)In reply to: Hardware-level micro-op optimization by corbet
Parent article: Spectre V1 defense in GCC
I agree, but the op that set the status flag was not a speculative op (unless it was in a block that is itself speculative*); it was a regular check that was supposed to be guarding the block where we inserted the conditional move, with, most likely, no micro-ops between it and the conditional move, thus ideally situated to be made unconditional.
(*Speculation may pile upon speculation, up to the limit of microarchitectural resources.)
Ultimately we will need assurances from vendors that the conditional nature of the move is not, and won't ever be, optimized away. Later, we will want another version of conditional move that we specifically allow to be micro-optimized; but first things first.