================
@@ -522,6 +526,28 @@ let Predicates = [BPFNoALU32] in {
}
def STD : STOREi64<BPF_DW, "u64", store>;
+class relaxed_store<PatFrag base>
+ : PatFrag<(ops node:$val, node:$ptr), (base node:$val, node:$ptr)> {
+ let IsAtomic = 1;
+ let IsAtomicOrderingReleaseOrStronger = 0;
+}
+
+class releasing_store<PatFrag base>
+ : PatFrag<(ops node:$val, node:$ptr), (base node:$val, node:$ptr)> {
+ let IsAtomic = 1;
+ let IsAtomicOrderingRelease = 1;
+}
----------------
yonghong-song wrote:
> Eduard [suggested
> earlier](https://github.com/llvm/llvm-project/pull/108636#discussion_r1765597286)
> (referencing [Andrii's
> suggestion](https://github.com/llvm/llvm-project/pull/107343#issuecomment-2334664935)
> in #107343) that, for now, we "fall back" to `ACQUIRE` or `RELEASE` if user
> requested `RELAXED`, until we actually support `RELAXED` in the future.
>
> > Is my interpretation correct or __atomic_load_n(ptr, __ATOMIC_RELAXED)
> > could have semantics beyond '*ptr'?
>
> `__ATOMIC_RELAXED` still guarantees atomicity but `*ptr` does not, if i'm
> understanding correctly?
bpf prog does not support misaligned load/store etc. So for 'int *ptr', 'long
*ptr', etc. dereference will have a single load or store and it is atomic.
https://github.com/llvm/llvm-project/pull/108636
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits