Webcentive RISC-V Reference

fence.tso

Memory ordering fence, total store ordering

Extension
RV32I/RV64I base integer
XLEN
RV32 and RV64
Assembly (riscv-unified-db)
fence.tso
Length
32-bit

Encoding

listed in riscv-opcodes as a pseudo-op of fence

312827242320191514121176210
100000110011rs1000rd0001111

Match 0x8330000f, mask 0xfff0707f. Source: $pseudo_op rv_i::fence fence.tso 31..28=8 27..24=3 23..20=3 rs1 14..12=0 rd 6..2=0x03 1..0=3 in riscv-opcodes/extensions/rv_i.

FieldBitsriscv-opcodes name
rs119:15rs1
rd11:7rd

Description

Orders memory operations.

fence.tso orders all load operations in its predecessor set before all memory operations in its successor set, and all store operations in its predecessor set before all store operations in its successor set. This leaves non-AMO store operations in the 'fence.tso's predecessor set unordered with non-AMO loads in its successor set.

The xs1 and xd fields are unused and ignored.

In modes other than M-mode, fence.tso is further affected by menvcfg.FIOM, senvcfg.FIOM(when H is implemented: , and/or henvcfg.FIOM).

Description from riscv-unified-db, reformatted.

Operation

fence_tso();

Pseudocode in riscv-unified-db’s IDL, quoted unchanged.

Specification and related pages