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

Side by Side Diff: src/IceIntrinsics.h

Issue 1904233002: Subzero: Fix over-aggressive bool folding. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Hack for pure virtual method Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/IceInst.cpp ('k') | src/IceIntrinsics.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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;
117 }; 120 };
121 static_assert(sizeof(IntrinsicInfo) == 4, "IntrinsicInfo should be 32 bits");
118 122
119 /// The types of validation values for FullIntrinsicInfo.validateCall. 123 /// The types of validation values for FullIntrinsicInfo.validateCall.
120 enum ValidateCallValue { 124 enum ValidateCallValue {
121 IsValidCall, /// Valid use of instrinsic call. 125 IsValidCall, /// Valid use of instrinsic call.
122 BadReturnType, /// Return type invalid for intrinsic. 126 BadReturnType, /// Return type invalid for intrinsic.
123 WrongNumOfArgs, /// Wrong number of arguments for intrinsic. 127 WrongNumOfArgs, /// Wrong number of arguments for intrinsic.
124 WrongCallArgType, /// Argument of wrong type. 128 WrongCallArgType, /// Argument of wrong type.
125 }; 129 };
126 130
127 /// The complete set of information about an intrinsic. 131 /// The complete set of information about an intrinsic.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 169
166 private: 170 private:
167 // TODO(jvoung): May want to switch to something like LLVM's StringMap. 171 // TODO(jvoung): May want to switch to something like LLVM's StringMap.
168 using IntrinsicMap = std::unordered_map<GlobalString, FullIntrinsicInfo>; 172 using IntrinsicMap = std::unordered_map<GlobalString, FullIntrinsicInfo>;
169 IntrinsicMap Map; 173 IntrinsicMap Map;
170 }; 174 };
171 175
172 } // end of namespace Ice 176 } // end of namespace Ice
173 177
174 #endif // SUBZERO_SRC_ICEINTRINSICS_H 178 #endif // SUBZERO_SRC_ICEINTRINSICS_H
OLDNEW
« no previous file with comments | « src/IceInst.cpp ('k') | src/IceIntrinsics.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698