I don't really understand the difference between a normal FENCE in RISC-V (has been answered here: What is meant by the FENCE instruction in the RISC-V instruction set?) and the FENCE.TSO. The manual says:
The optional FENCE.TSO instruction is encoded as a FENCE instruction with fm=1000, predecessor=RW, and successor=RW. 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.
Okay, So here is my guess. I will just show my sketch from what I understood.
There are two sets (including instructions), which are being separated by the FENCE instruction, namely predecessor set and successor set.
Load Operation 1
Load Operation 2
Load Operation 3
Store Operation 1
Store Operation 2
Store Operation 3
**FENCE.TSO**
Memory Operation 1
Memory Operation 2
Memory Operation 3
Store Operation 4
Store Operation 5
Store Operation 6
This is how I understand it. But I'm still confused by the sentence This leaves non-AMO store operations in the FENCE.TSO’s predecessor set unordered with non-AMO loads in its successor set. What are non-AMO loads and non-AMO store operations?
Alright, AMO seems to stand for "Atomic Memory Operation". Still I'm wondering, why I can't just use the "normal" FENCE.