0

if a Load/Store following a branch instruction (eg. test/cmp/jmp)

how memory reorder handle ?

is a Load/Store can be reordered before/after these branch instruction ?

because the correctness may volatile.

a better simple but maybe slow method is branch instruction like a mfence, which prevent both side of reorder.

Chinaxing
  • 6,874
  • 4
  • 25
  • 34
  • You should probably tag this [cpu-architecture] as well. Looks like a duplicate of [Can a speculatively executed CPU branch contain opcodes that access RAM?](https://stackoverflow.com/q/64141366) which describes how a store buffer decouples speculative OoO exec from global visibility (to other cores) which must not be speculative. – Peter Cordes Jun 19 '21 at 09:57

0 Answers0