| OLD | NEW |
| 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 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 const size_t IceIntrinsicsTableSize = llvm::array_lengthof(IceIntrinsicsTable); | 200 const size_t IceIntrinsicsTableSize = llvm::array_lengthof(IceIntrinsicsTable); |
| 201 | 201 |
| 202 #undef INTRIN | 202 #undef INTRIN |
| 203 | 203 |
| 204 } // end of anonymous namespace | 204 } // end of anonymous namespace |
| 205 | 205 |
| 206 Intrinsics::Intrinsics() { | 206 Intrinsics::Intrinsics() { |
| 207 for (size_t I = 0; I < IceIntrinsicsTableSize; ++I) { | 207 for (size_t I = 0; I < IceIntrinsicsTableSize; ++I) { |
| 208 const struct IceIntrinsicsEntry_ &Entry = IceIntrinsicsTable[I]; | 208 const struct IceIntrinsicsEntry_ &Entry = IceIntrinsicsTable[I]; |
| 209 assert(Entry.Info.NumTypes <= kMaxIntrinsicParameters); | 209 assert(Entry.Info.NumTypes <= kMaxIntrinsicParameters); |
| 210 map.insert(std::make_pair(IceString(Entry.IntrinsicName), Entry.Info)); | 210 Map.insert(std::make_pair(IceString(Entry.IntrinsicName), Entry.Info)); |
| 211 } | 211 } |
| 212 } | 212 } |
| 213 | 213 |
| 214 Intrinsics::~Intrinsics() {} | 214 Intrinsics::~Intrinsics() {} |
| 215 | 215 |
| 216 const Intrinsics::FullIntrinsicInfo * | 216 const Intrinsics::FullIntrinsicInfo * |
| 217 Intrinsics::find(const IceString &Name) const { | 217 Intrinsics::find(const IceString &Name) const { |
| 218 IntrinsicMap::const_iterator it = map.find(Name); | 218 auto it = Map.find(Name); |
| 219 if (it == map.end()) | 219 if (it == Map.end()) |
| 220 return NULL; | 220 return NULL; |
| 221 return &it->second; | 221 return &it->second; |
| 222 } | 222 } |
| 223 | 223 |
| 224 bool Intrinsics::VerifyMemoryOrder(uint64_t Order) { | 224 bool Intrinsics::VerifyMemoryOrder(uint64_t Order) { |
| 225 // There is only one memory ordering for atomics allowed right now. | 225 // There is only one memory ordering for atomics allowed right now. |
| 226 return Order == Intrinsics::MemoryOrderSequentiallyConsistent; | 226 return Order == Intrinsics::MemoryOrderSequentiallyConsistent; |
| 227 } | 227 } |
| 228 | 228 |
| 229 Intrinsics::ValidateCallValue | 229 Intrinsics::ValidateCallValue |
| (...skipping 19 matching lines...) Expand all Loading... |
| 249 return Intrinsics::IsValidCall; | 249 return Intrinsics::IsValidCall; |
| 250 } | 250 } |
| 251 | 251 |
| 252 Type Intrinsics::FullIntrinsicInfo::getArgType(SizeT Index) const { | 252 Type Intrinsics::FullIntrinsicInfo::getArgType(SizeT Index) const { |
| 253 assert(NumTypes > 1); | 253 assert(NumTypes > 1); |
| 254 assert(Index + 1 < NumTypes); | 254 assert(Index + 1 < NumTypes); |
| 255 return Signature[Index + 1]; | 255 return Signature[Index + 1]; |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // end of namespace Ice | 258 } // end of namespace Ice |
| OLD | NEW |