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

Unified Diff: include/llvm/IR/NaCl.h

Issue 17777004: Concurrency support for PNaCl ABI (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: 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/NaCl.h
diff --git a/include/llvm/IR/NaCl.h b/include/llvm/IR/NaCl.h
new file mode 100644
index 0000000000000000000000000000000000000000..5fc79f83226db17b5e98ce7d1185aee542f11b0f
--- /dev/null
+++ b/include/llvm/IR/NaCl.h
@@ -0,0 +1,72 @@
+//===-- llvm/IR/NaCl.h - NaCl Intrinsic Function Handling -------*- C++ -*-===//
eliben 2013/06/26 16:20:57 If this is just intrinsics, then perhaps NaclIntri
JF 2013/06/26 22:23:12 Done.
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines a set of enums which allow processing of intrinsic
+// functions that are specific to NaCl. The order of these enums should
eliben 2013/06/26 16:20:57 Not sure what "the order of these enums" means ?
JF 2013/06/26 22:23:12 Moved to the actual enums below.
+// not change: they offer forward compatibility of bitcode targeted to
+// NaCl.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_IR_NACL_H
+#define LLVM_IR_NACL_H
+
+#include "llvm/IR/Intrinsics.h"
+
+namespace llvm {
+
+namespace NaCl {
+
+const struct {
+ Intrinsic::ID ID;
+ unsigned BitSize;
+} AtomicIntrinsics[] = {
+ { Intrinsic::nacl_atomic_8, 8 },
+ { Intrinsic::nacl_atomic_16, 16 },
+ { Intrinsic::nacl_atomic_32, 32 },
+ { Intrinsic::nacl_atomic_64, 64 }
+};
+
+enum {
eliben 2013/06/26 16:20:57 Why not a const size_t ?
JF 2013/06/26 22:23:12 Done. My C shows.
+ NumAtomicIntrinsics = sizeof(AtomicIntrinsics) / sizeof(AtomicIntrinsics[0])
+};
+
+// Operations that can be represented by the nacl.atomic.<size> intrinsics.
+enum AtomicOperation {
+ AtomicInvalid = 0, // Invalid, keep first.
+ AtomicLoad,
+ AtomicStore,
+ AtomicAdd,
+ AtomicSub,
+ AtomicOr,
+ AtomicAnd,
+ AtomicXor,
+ AtomicXchg,
+ AtomicCmpXchg,
+ AtomicFence,
+ AtomicNum // Invalid, keep last.
+};
+
+// Memory orderings supported by C11/C++11.
+enum MemoryOrder {
+ MemoryOrderInvalid = 0, // Invalid, keep first.
+ MemoryOrderRelaxed,
+ MemoryOrderConsume,
+ MemoryOrderAcquire,
+ MemoryOrderRelease,
+ MemoryOrderAcquireRelease,
+ MemoryOrderSequentiallyConsistent,
+ MemoryOrderNum // Invalid, keep last.
+};
+
+} // End NaCl namespace
+
+} // End llvm namespace
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698