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 |