[clang] [llvm] [BPF] Add load-acquire and store-release instructions under -mcpu=v4 (PR #108636)

via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 28 09:30:28 PDT 2024


================
@@ -48,6 +48,24 @@ def BPF_END  : BPFArithOp<0xd>;
 def BPF_XCHG    : BPFArithOp<0xe>;
 def BPF_CMPXCHG : BPFArithOp<0xf>;
 
+class BPFAtomicLoadStoreOp<bits<4> val> {
+  bits<4> Value = val;
+}
+
+def BPF_ATOMIC_LOAD : BPFAtomicLoadStoreOp<0x1>;
+def BPF_ATOMIC_STORE : BPFAtomicLoadStoreOp<0x2>;
+
+class BPFAtomicOrdering<bits<4> val> {
+  bits<4> Value = val;
+}
+
+def BPF_RELAXED : BPFAtomicOrdering<0x0>;
+def BPF_CONSUME : BPFAtomicOrdering<0x1>;
----------------
yonghong-song wrote:

Let use remove BPF_CONSUME? In kernel, we are not using atomic operation with CONSUME. In current BPF implementation, for operations like atomic_load_{add, sub,and,or,xor}, we do not support consume either.

https://github.com/llvm/llvm-project/pull/108636


More information about the cfe-commits mailing list