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

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

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/NaClIntrinsics.h
diff --git a/include/llvm/IR/NaClIntrinsics.h b/include/llvm/IR/NaClIntrinsics.h
new file mode 100644
index 0000000000000000000000000000000000000000..64a963ce67ea87dd840f86718326d66592b1318b
--- /dev/null
+++ b/include/llvm/IR/NaClIntrinsics.h
@@ -0,0 +1,75 @@
+//===-- llvm/IR/NaClIntrinsics.h - NaCl Intrinsics --------------*- C++ -*-===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_IR_NACL_H
+#define LLVM_IR_NACL_H
+
+#include "llvm/IR/Intrinsics.h"
+#include <cstddef>
+
+namespace llvm {
+
+namespace NaCl {
+
+static 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 } };
+
+static const size_t NumAtomicIntrinsics =
+ sizeof(AtomicIntrinsics) / sizeof(AtomicIntrinsics[0]);
+
+// Operations that can be represented by the @llvm.nacl.atomic.<size>
+// intrinsics.
+//
+// Do not reorder these values: their order offers forward compatibility
+// of bitcode targeted to NaCl.
+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.
+//
+// Do not reorder these values: their order offers forward compatibility
+// of bitcode targeted to NaCl.
+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