riscv icon indicating copy to clipboard operation
riscv copied to clipboard

`riscv`: Support more fence variants

Open jsgf opened this issue 1 year ago • 1 comments

The default fence instruction with no parameters is the strongest form of barrier. But it also takes an optional set of flags to give fine-grained control over exactly what operations the fence is a barrier for, and in which direction.

I see two design choices here:

  • just let the caller specify an arbitrary set of flags (somehow), or
  • have a set of canned variants for the common cases (like Linux's rmb/wmb/...)

(These aren't exclusive of course.)

Thoughts?

cc @dreiss

jsgf avatar Mar 14 '24 18:03 jsgf

Hi! I need to think more about this, but currently, I think that riscv should support common cases. For very specific scenarios, developers could always use inline assembly.

romancardenas avatar Mar 15 '24 10:03 romancardenas