Does FENCE flush caches?
Its architectural semantics are ordering constraints, not a general cache flush.
Order memory reads/writes and device I/O operations according to pred/succ sets.
FENCE uses opcode 0001111 (0x0f), funct3 000. FENCE encodings use pred/succ and fm fields to describe ordering constraints, not an ordinary register-operation format.
FENCE uses pred and succ fields to name predecessor and successor operation sets: I for device input, O for device output, R for memory reads, and W for memory writes. It constrains the ordering of memory and I/O operations made observable by the current hart to other harts or external devices; standard software should set reserved rd and rs1 fields to zero.
FENCE is not a cache flush. It establishes ordering constraints for this hart's memory and device I/O operations according to the pred/succ sets.
Understand this scenario with real code like «fence rw, rw # full memory barrier: prior reads+writes before subsequent reads+writes».
Understand this scenario with real code like «fence rw, rw # full memory barrier: prior reads+writes before subsequent reads+writes».
Understand this scenario with real code like «fence rw, rw # full memory barrier: prior reads+writes before subsequent reads+writes».
Its architectural semantics are ordering constraints, not a general cache flush.
No. It constrains the order in which the current hart's relevant operations become observable to other observers.