m3front/src/builtinAtomic/atomic.tmpl


readonly proc atomic (T) is
  build_generic_intf ("IsLockFree" & T, "IsLockFree", [], HIDDEN)
  build_generic_intf ("Store" & T, "Store", [], HIDDEN)
  build_generic_intf ("Load" & T, "Load", [], HIDDEN)
  build_generic_intf ("Swap" & T, "Swap", [], HIDDEN)
  build_generic_intf ("CompareSwap" & T, "CompareSwap", [], HIDDEN)
  build_generic_intf ("Fence" & T, "Fence", [], HIDDEN)
  build_generic_intf ("FetchInc" & T, "FetchInc", [], HIDDEN)
  build_generic_intf ("FetchDec" & T, "FetchDec", [], HIDDEN)
  build_generic_intf ("FetchOr" & T, "FetchOr", [], HIDDEN)
  build_generic_intf ("FetchXor" & T, "FetchXor", [], HIDDEN)
  build_generic_intf ("FetchAnd" & T, "FetchAnd", [], HIDDEN)

  build_generic_impl ("IsLockFree" & T, "IsLockFree", [T])
  build_generic_impl ("Store" & T, "Store", [T, "Atomic" & T & "Module"])
  build_generic_impl ("Load" & T, "Load", [T, "Atomic" & T & "Module"])
  build_generic_impl ("Swap" & T, "Swap", [T, "Atomic" & T & "Module"])
  build_generic_impl ("CompareSwap" & T, "CompareSwap", [T, "Atomic" & T & "Module"])
  build_generic_impl ("Fence" & T, "Fence", ["Atomic" & T & "Module"])
  build_generic_impl ("FetchInc" & T, "FetchInc", [T, "Atomic" & T & "Module"])
  build_generic_impl ("FetchDec" & T, "FetchDec", [T, "Atomic" & T & "Module"])
  build_generic_impl ("FetchOr" & T, "FetchOr", [T, "Atomic" & T & "Module"])
  build_generic_impl ("FetchXor" & T, "FetchXor", [T, "Atomic" & T & "Module"])
  build_generic_impl ("FetchAnd" & T, "FetchAnd", [T, "Atomic" & T & "Module"])

  build_generic_intf ("Atomic" & T & "Module", "AtomicModule", [], HIDDEN)
  build_generic_impl ("Atomic" & T & "Module", "AtomicModule",
   [T,
    "IsLockFree" & T, "Store" & T, "Load" & T, "Swap" & T,
    "CompareSwap" & T, "Fence" & T, "FetchInc" & T, "FetchDec" & T,
    "FetchOr" & T, "FetchXor" & T, "FetchAnd" & T])
end