[Pitch] Low-level operations for volatile memory accesses

@_transparent should be used with care, since it causes the function body to be involved with SIL diagnostics, and it isn't clear to me that it's appropriate even for the APIs discussed here as opposed to their being @inline(__always). User code should never have any business using @_transparent.

4 Likes

I think you really want three types here, to express the legal operations that are allowed to be performed on the pointer:

  • load only
  • store only
  • load and store

There are MMIO that are write-only (and read-only), and I think you want to be able to express those semantics, eg, in a "header that describes all the memory-mapped features of this platform".

1 Like