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

Side by Side Diff: src/IceIntrinsics.cpp

Issue 577353003: Add call instructions to Subzero's bitcode reader. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix remaining issues raised. Created 6 years, 3 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/IceIntrinsics.h ('k') | src/IceTargetLoweringX8632.h » ('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.cpp - Functions related to intrinsics ----===// 1 //===- subzero/src/IceIntrinsics.cpp - Functions related to intrinsics ----===//
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 implements the Intrinsics utilities for matching and 10 // This file implements the Intrinsics utilities for matching and
11 // then dispatching by name. 11 // then dispatching by name.
12 // 12 //
13 //===----------------------------------------------------------------------===// 13 //===----------------------------------------------------------------------===//
14 14
15 #include "IceCfg.h" 15 #include "IceCfg.h"
16 #include "IceCfgNode.h" 16 #include "IceCfgNode.h"
17 #include "IceInst.h"
17 #include "IceIntrinsics.h" 18 #include "IceIntrinsics.h"
18 #include "IceLiveness.h" 19 #include "IceLiveness.h"
19 #include "IceOperand.h" 20 #include "IceOperand.h"
20 21
21 #include <utility> 22 #include <utility>
22 23
23 namespace Ice { 24 namespace Ice {
24 25
25 namespace { 26 namespace {
26 27
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 if (it == map.end()) 220 if (it == map.end())
220 return NULL; 221 return NULL;
221 return &it->second; 222 return &it->second;
222 } 223 }
223 224
224 bool Intrinsics::VerifyMemoryOrder(uint64_t Order) { 225 bool Intrinsics::VerifyMemoryOrder(uint64_t Order) {
225 // There is only one memory ordering for atomics allowed right now. 226 // There is only one memory ordering for atomics allowed right now.
226 return Order == Intrinsics::MemoryOrderSequentiallyConsistent; 227 return Order == Intrinsics::MemoryOrderSequentiallyConsistent;
227 } 228 }
228 229
230 Intrinsics::ValidateCallValue
231 Intrinsics::FullIntrinsicInfo::validateCall(const Ice::InstCall *Call,
232 SizeT &ArgIndex) const {
233 assert(NumTypes >= 1);
234 Variable *Result = Call->getDest();
235 if (Result == NULL) {
236 if (Signature[0] != Ice::IceType_void)
237 return Intrinsics::BadReturnType;
238 } else if (Signature[0] != Result->getType()) {
239 return Intrinsics::BadReturnType;
240 }
241 if (Call->getNumArgs() + 1 != NumTypes) {
242 return Intrinsics::WrongNumOfArgs;
243 }
244 for (size_t i = 1; i < NumTypes; ++i) {
245 if (Call->getArg(i - 1)->getType() != Signature[i]) {
246 ArgIndex = i;
247 return Intrinsics::WrongCallArgType;
248 }
249 }
250 return Intrinsics::IsValidCall;
251 }
252
253 Type Intrinsics::FullIntrinsicInfo::getArgType(SizeT Index) const {
254 assert(NumTypes > 1);
255 assert(Index + 1 < NumTypes);
256 return Signature[Index + 1];
257 }
258
229 } // end of namespace Ice 259 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceIntrinsics.h ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698