Home/Instructions/FENCE-TSO
FENCE.TSO

RISC-V FENCE.TSO Instruction Details

Instruction ManualI-type

A specific FENCE TSO encoding that orders memory R/W, excludes device I/O, and does not force store-to-load ordering.

Instruction Syntax

fence.tso
Operand Breakdown
Verify this is the no-explicit-operand FENCE.TSO encoding.
Verify the need is R/W memory ordering, not I/O ordering or cache flushing.
RV32ICache & Sync

Instruction Behavior

FENCE.TSO is a specific FENCE encoding (fm=1000, pred=RW, succ=RW). It orders memory R/W operations but does not include device I/O bits; compared with FENCE RW,RW, it does not require predecessor stores to be ordered before successor loads. Implementations may execute it as the stronger FENCE RW,RW.

FENCE.TSO Decode And Ordering Animation

Shows the FENCE opcode encoding, fm/pred/succ fields, and current-hart observable ordering constraints without modeling cache, bus, or pipeline behavior.

no explicit operands
fence.tsofence.tso
Execution Contextcurrent-hart observable orderingnot a cache flush
31..28
27..24
23..20
19..15
14..12
11..7
6..0
1000
fm
0011
pred
0011
succ
00000
rs1=x0
000
funct3
00000
rd=x0
0001111
MISC-MEM
instruction
0x8330000F
opcode
0001111 -> MISC-MEM/FENCE
fm
1000 -> TSO
pred
0011 -> RW
succ
0011 -> RW
reserved
rs1=x0, rd=x0, funct3=000
ordering
orders memory R/W, excludes I/O, and does not force predecessor stores before successor loads
complete
ordering constraint complete

This animation shows only FENCE/PAUSE architectural semantics defined by the RISC-V unprivileged ISA; it does not represent processor-specific pause duration, cache behavior, interconnect protocol, or execution cost.

Quick Understanding & Search Notes

FENCE.TSO is a specific TSO FENCE encoding: it covers only memory R/W, not device I/O, and allows predecessor stores not to be ordered before successor loads.

fm=1000 with pred=RW and succ=RW is the FENCE.TSO encoding.
FENCE.TSO has no I/O bits and cannot replace a FENCE that includes I/O ordering.
Compared with FENCE RW,RW, it does not require store-to-load ordering.
An implementation may execute FENCE.TSO as the stronger FENCE RW,RW.

Common Usage Scenarios

Memory Ordering

Understand this scenario with real code like «fence.tso # TSO-style memory ordering for R/W accesses».

Device & IO

Understand this scenario with real code like «fence.tso # TSO-style memory ordering for R/W accesses».

Concurrent Synchronization

Understand this scenario with real code like «fence.tso # TSO-style memory ordering for R/W accesses».

Pre-Use Checklist

Syntax Check
  • Verify this is the no-explicit-operand FENCE.TSO encoding.
  • Verify the need is R/W memory ordering, not I/O ordering or cache flushing.
Semantic Check
  • Confirm the need is an ordering constraint for the current hart's operations becoming visible.
  • Confirm whether I/O bits are needed; FENCE.TSO does not order device I/O.

Pitfalls / Common Confusions

FENCE.TSO does not order device I/O; use a FENCE with I/O bits when I/O ordering is required.
FENCE.TSO is weaker than FENCE RW,RW because it does not force store-to-load ordering.
Implementations may execute it as the stronger FENCE RW,RW, so do not assume it is always cheaper.

FAQ

Does FENCE.TSO order device I/O?

No. Its pred/succ sets include only R/W memory bits, not I/O bits.

Is FENCE.TSO as strong as fence rw,rw?

Architecturally it is weaker because it does not require predecessor stores before successor loads, although an implementation may execute it as the stronger fence rw,rw.