Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Unified Diff: include/llvm/IR/Intrinsics.td

Issue 17777004: Concurrency support for PNaCl ABI (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Update PNaClLangRef to reflect the implementation work I will now go forward with. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: include/llvm/IR/Intrinsics.td
diff --git a/include/llvm/IR/Intrinsics.td b/include/llvm/IR/Intrinsics.td
index 3e496204350e8fc932d2070af8be7a8ea7fff48a..4ca3db4a483a16b63c0b24a32f4bf464d8bd9bec 100644
--- a/include/llvm/IR/Intrinsics.td
+++ b/include/llvm/IR/Intrinsics.td
@@ -498,6 +498,31 @@ def int_nacl_tp_tdb_offset : Intrinsic<[llvm_i32_ty], [llvm_i32_ty]>,
// pnaclintrin.h.
def int_nacl_target_arch : Intrinsic<[llvm_i32_ty], []>,
GCCBuiltin<"__builtin_nacl_target_arch">;
+
+// Atomic intrinsics.
+//
+// Volatiles and atomics are encoded through these intrinsics to make
+// them platform-independent, remove some of LLVM's legacy, and isolate
+// PNaCl from future changes to IR. The intrinsics allow user code to
+// use `__sync_*` builtins as well as C11/C++11 atomics.
+//
+// These are further documented in docs/PNaClLangRef.rst.
+def int_nacl_atomic_8 : Intrinsic<[llvm_i8_ty],
+ [llvm_i32_ty, LLVMPointerType<llvm_i8_ty>,
+ llvm_i8_ty, llvm_i8_ty, llvm_i32_ty],
+ [IntrReadWriteArgMem]>;
+def int_nacl_atomic_16 : Intrinsic<[llvm_i16_ty],
+ [llvm_i32_ty, LLVMPointerType<llvm_i16_ty>,
+ llvm_i16_ty, llvm_i16_ty, llvm_i32_ty],
+ [IntrReadWriteArgMem]>;
+def int_nacl_atomic_32 : Intrinsic<[llvm_i32_ty],
+ [llvm_i32_ty, LLVMPointerType<llvm_i32_ty>,
+ llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
+ [IntrReadWriteArgMem]>;
+def int_nacl_atomic_64 : Intrinsic<[llvm_i64_ty],
+ [llvm_i32_ty, LLVMPointerType<llvm_i64_ty>,
+ llvm_i64_ty, llvm_i64_ty, llvm_i32_ty],
+ [IntrReadWriteArgMem]>;
// @LOCALMOD-END
//===----------------------------------------------------------------------===//

Powered by Google App Engine
This is Rietveld 408576698