OLD | NEW |
1 //===- subzero/src/IceIntrinsics.h - List of Ice Intrinsics -----*- C++ -*-===// | 1 //===- subzero/src/IceIntrinsics.h - List of Ice Intrinsics -----*- C++ -*-===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
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 declares the kinds of intrinsics supported by PNaCl. | 10 // This file declares the kinds of intrinsics supported by PNaCl. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 MemoryOrderAcquire, | 82 MemoryOrderAcquire, |
83 MemoryOrderRelease, | 83 MemoryOrderRelease, |
84 MemoryOrderAcquireRelease, | 84 MemoryOrderAcquireRelease, |
85 MemoryOrderSequentiallyConsistent, | 85 MemoryOrderSequentiallyConsistent, |
86 MemoryOrderNum // Invalid, keep last. | 86 MemoryOrderNum // Invalid, keep last. |
87 }; | 87 }; |
88 | 88 |
89 static bool VerifyMemoryOrder(uint64_t Order); | 89 static bool VerifyMemoryOrder(uint64_t Order); |
90 | 90 |
91 // Basic attributes related to each intrinsic, that are relevant to | 91 // Basic attributes related to each intrinsic, that are relevant to |
92 // code generation. We will want to have more attributes (e.g., Setjmp | 92 // code generation. Perhaps the attributes representation can be shared |
93 // returns twice and which affects stack coloring) once the lowering | 93 // with general function calls, but PNaCl currently strips all |
94 // cares about such attributes. Perhaps the attributes representation | 94 // attributes from functions. |
95 // can be shared with general function calls, though most functions | |
96 // will be opaque. | |
97 struct IntrinsicInfo { | 95 struct IntrinsicInfo { |
98 IntrinsicID ID : 31; | 96 IntrinsicID ID : 30; |
99 bool HasSideEffects : 1; | 97 bool HasSideEffects : 1; |
| 98 bool ReturnsTwice : 1; |
100 }; | 99 }; |
101 | 100 |
102 // The complete set of information about an intrinsic. | 101 // The complete set of information about an intrinsic. |
103 struct FullIntrinsicInfo { | 102 struct FullIntrinsicInfo { |
104 struct IntrinsicInfo Info; // Information that CodeGen would care about. | 103 struct IntrinsicInfo Info; // Information that CodeGen would care about. |
105 | 104 |
106 // Sanity check during parsing. | 105 // Sanity check during parsing. |
107 Type Signature[kMaxIntrinsicParameters]; | 106 Type Signature[kMaxIntrinsicParameters]; |
108 uint8_t NumTypes; | 107 uint8_t NumTypes; |
109 }; | 108 }; |
110 | 109 |
111 // Find the information about a given intrinsic, based on function name. | 110 // Find the information about a given intrinsic, based on function name. |
112 // The function name is expected to have the common "llvm." prefix | 111 // The function name is expected to have the common "llvm." prefix |
113 // stripped. If found, returns a reference to a FullIntrinsicInfo entry | 112 // stripped. If found, returns a reference to a FullIntrinsicInfo entry |
114 // (valid for the lifetime of the map). Otherwise returns null. | 113 // (valid for the lifetime of the map). Otherwise returns null. |
115 const FullIntrinsicInfo *find(const IceString &Name) const; | 114 const FullIntrinsicInfo *find(const IceString &Name) const; |
116 | 115 |
117 private: | 116 private: |
118 // TODO(jvoung): May want to switch to something like LLVM's StringMap. | 117 // TODO(jvoung): May want to switch to something like LLVM's StringMap. |
119 typedef std::map<IceString, FullIntrinsicInfo> IntrinsicMap; | 118 typedef std::map<IceString, FullIntrinsicInfo> IntrinsicMap; |
120 IntrinsicMap map; | 119 IntrinsicMap map; |
121 | 120 |
122 Intrinsics(const Intrinsics &) LLVM_DELETED_FUNCTION; | 121 Intrinsics(const Intrinsics &) LLVM_DELETED_FUNCTION; |
123 Intrinsics &operator=(const Intrinsics &) LLVM_DELETED_FUNCTION; | 122 Intrinsics &operator=(const Intrinsics &) LLVM_DELETED_FUNCTION; |
124 }; | 123 }; |
125 | 124 |
126 } // end of namespace Ice | 125 } // end of namespace Ice |
127 | 126 |
128 #endif // SUBZERO_SRC_ICEINTRINSICS_H | 127 #endif // SUBZERO_SRC_ICEINTRINSICS_H |
OLD | NEW |