OLD | NEW |
1 //===-- llvm/IR/NaClAtomicIntrinsics.h - NaCl Atomic Intrinsics -*- C++ -*-===// | 1 //===-- llvm/IR/NaClAtomicIntrinsics.h - NaCl Atomic Intrinsics -*- C++ -*-===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file describes atomic intrinsic functions that are specific to NaCl. | 10 // This file describes atomic intrinsic functions that are specific to NaCl. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 /// Do not reorder these values: their order offers forward | 93 /// Do not reorder these values: their order offers forward |
94 /// compatibility of bitcode targeted to NaCl. | 94 /// compatibility of bitcode targeted to NaCl. |
95 enum MemoryOrder { | 95 enum MemoryOrder { |
96 MemoryOrderInvalid = 0, // Invalid, keep first. | 96 MemoryOrderInvalid = 0, // Invalid, keep first. |
97 MemoryOrderRelaxed, | 97 MemoryOrderRelaxed, |
98 MemoryOrderConsume, | 98 MemoryOrderConsume, |
99 MemoryOrderAcquire, | 99 MemoryOrderAcquire, |
100 MemoryOrderRelease, | 100 MemoryOrderRelease, |
101 MemoryOrderAcquireRelease, | 101 MemoryOrderAcquireRelease, |
102 MemoryOrderSequentiallyConsistent, | 102 MemoryOrderSequentiallyConsistent, |
| 103 // The following memory order is specific to PNaCl and is used to |
| 104 // support non-C11/C++11 legacy code which uses the __sync_synchronize |
| 105 // GCC-style builtin and the asm("":::"memory") compiler fence |
| 106 // idiom. It's equivalent to MemoryOrderSequentiallyConsistent |
| 107 // surrounded by compiler barriers, which means that in practice is |
| 108 // should prevent reordering of memory accesses to objects which may |
| 109 // escape. |
| 110 MemoryOrderSequentiallyConsistentAll, |
103 MemoryOrderNum // Invalid, keep last. | 111 MemoryOrderNum // Invalid, keep last. |
104 }; | 112 }; |
105 | 113 |
106 } // End NaCl namespace | 114 } // End NaCl namespace |
107 | 115 |
108 } // End llvm namespace | 116 } // End llvm namespace |
109 | 117 |
110 #endif | 118 #endif |
OLD | NEW |