Chromium Code Reviews| 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 /// \file | 10 /// \file |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 // TODO(stichnot,kschimpf): Perform memory order validation in the bitcode | 99 // TODO(stichnot,kschimpf): Perform memory order validation in the bitcode |
| 100 // reader/parser, allowing LLVM and Subzero to share. See | 100 // reader/parser, allowing LLVM and Subzero to share. See |
| 101 // https://code.google.com/p/nativeclient/issues/detail?id=4126 . | 101 // https://code.google.com/p/nativeclient/issues/detail?id=4126 . |
| 102 static bool isMemoryOrderValid(IntrinsicID ID, uint64_t Order, | 102 static bool isMemoryOrderValid(IntrinsicID ID, uint64_t Order, |
| 103 uint64_t OrderOther = MemoryOrderInvalid); | 103 uint64_t OrderOther = MemoryOrderInvalid); |
| 104 | 104 |
| 105 enum SideEffects { SideEffects_F = 0, SideEffects_T = 1 }; | 105 enum SideEffects { SideEffects_F = 0, SideEffects_T = 1 }; |
| 106 | 106 |
| 107 enum ReturnsTwice { ReturnsTwice_F = 0, ReturnsTwice_T = 1 }; | 107 enum ReturnsTwice { ReturnsTwice_F = 0, ReturnsTwice_T = 1 }; |
| 108 | 108 |
| 109 enum MemoryWrite { MemoryWrite_F = 0, MemoryWrite_T = 1 }; | |
| 110 | |
| 109 /// Basic attributes related to each intrinsic, that are relevant to code | 111 /// Basic attributes related to each intrinsic, that are relevant to code |
| 110 /// generation. Perhaps the attributes representation can be shared with | 112 /// generation. Perhaps the attributes representation can be shared with |
| 111 /// general function calls, but PNaCl currently strips all attributes from | 113 /// general function calls, but PNaCl currently strips all attributes from |
| 112 /// functions. | 114 /// functions. |
| 113 struct IntrinsicInfo { | 115 struct IntrinsicInfo { |
| 114 enum IntrinsicID ID : 30; | 116 enum IntrinsicID ID : 29; |
| 115 enum SideEffects HasSideEffects : 1; | 117 enum SideEffects HasSideEffects : 1; |
| 116 enum ReturnsTwice ReturnsTwice : 1; | 118 enum ReturnsTwice ReturnsTwice : 1; |
| 119 enum MemoryWrite IsMemoryWrite : 1; | |
|
Eric Holk
2016/04/21 22:09:43
It looks like this struct is meant to be 32-bits.
Jim Stichnoth
2016/04/21 22:50:29
Done.
| |
| 117 }; | 120 }; |
| 118 | 121 |
| 119 /// The types of validation values for FullIntrinsicInfo.validateCall. | 122 /// The types of validation values for FullIntrinsicInfo.validateCall. |
| 120 enum ValidateCallValue { | 123 enum ValidateCallValue { |
| 121 IsValidCall, /// Valid use of instrinsic call. | 124 IsValidCall, /// Valid use of instrinsic call. |
| 122 BadReturnType, /// Return type invalid for intrinsic. | 125 BadReturnType, /// Return type invalid for intrinsic. |
| 123 WrongNumOfArgs, /// Wrong number of arguments for intrinsic. | 126 WrongNumOfArgs, /// Wrong number of arguments for intrinsic. |
| 124 WrongCallArgType, /// Argument of wrong type. | 127 WrongCallArgType, /// Argument of wrong type. |
| 125 }; | 128 }; |
| 126 | 129 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 | 168 |
| 166 private: | 169 private: |
| 167 // TODO(jvoung): May want to switch to something like LLVM's StringMap. | 170 // TODO(jvoung): May want to switch to something like LLVM's StringMap. |
| 168 using IntrinsicMap = std::unordered_map<GlobalString, FullIntrinsicInfo>; | 171 using IntrinsicMap = std::unordered_map<GlobalString, FullIntrinsicInfo>; |
| 169 IntrinsicMap Map; | 172 IntrinsicMap Map; |
| 170 }; | 173 }; |
| 171 | 174 |
| 172 } // end of namespace Ice | 175 } // end of namespace Ice |
| 173 | 176 |
| 174 #endif // SUBZERO_SRC_ICEINTRINSICS_H | 177 #endif // SUBZERO_SRC_ICEINTRINSICS_H |
| OLD | NEW |