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

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 25 11:32:54 PDT 2024


================
@@ -48,6 +48,13 @@ 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_LOAD_ACQ : BPFAtomicLoadStoreOp<0x1>;
+def BPF_STORE_REL : BPFAtomicLoadStoreOp<0xb>;
----------------
yonghong-song wrote:

Currently, gcc/clang does support atomic 'mem *= r1' operations. So I tempt to use 0x2. But based on your above explanation, I think your current using 0xb is okay since there is no chance to have an atomic operation for mov.

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


More information about the llvm-commits mailing list