Lines Matching defs:words

168 LogicalResult spirv::Deserializer::processExtension(ArrayRef<uint32_t> words) {
169 if (words.empty()) {
176 StringRef extName = decodeStringLiteral(words, wordIndex);
177 if (wordIndex != words.size())
179 "unexpected trailing words in OpExtension instruction");
189 spirv::Deserializer::processExtInstImport(ArrayRef<uint32_t> words) {
190 if (words.size() < 2) {
197 extendedInstSets[words[0]] = decodeStringLiteral(words, wordIndex);
198 if (wordIndex != words.size()) {
200 "unexpected trailing words in OpExtInstImport");
232 DenseMap<uint32_t, NamedAttrList> &decorations, ArrayRef<uint32_t> words,
234 if (words.size() != 4) {
239 unsigned cacheLevel = words[2];
240 auto cacheControlAttr = static_cast<EnumTy>(words[3]);
244 llvm::dyn_cast_or_null<ArrayAttr>(decorations[words[0]].get(symbol)))
247 decorations[words[0]].set(symbol, opBuilder.getArrayAttr(attrs));
251 LogicalResult spirv::Deserializer::processDecoration(ArrayRef<uint32_t> words) {
255 if (words.size() < 2) {
260 stringifyDecoration(static_cast<spirv::Decoration>(words[1]));
262 return emitError(unknownLoc, "invalid Decoration code : ") << words[1];
265 switch (static_cast<spirv::Decoration>(words[1])) {
267 if (words.size() != 3) {
271 decorations[words[0]].set(
273 static_cast<FPFastMathMode>(words[2])));
276 if (words.size() != 3) {
280 decorations[words[0]].set(
282 static_cast<FPRoundingMode>(words[2])));
286 if (words.size() != 3) {
290 decorations[words[0]].set(
291 symbol, opBuilder.getI32IntegerAttr(static_cast<int32_t>(words[2])));
294 if (words.size() != 3) {
298 decorations[words[0]].set(
300 stringifyBuiltIn(static_cast<spirv::BuiltIn>(words[2]))));
303 if (words.size() != 3) {
307 typeDecorations[words[0]] = words[2];
310 if (words.size() < 4) {
318 // hence the size of name is variable length which results in words.size()
319 // being variable length, words.size() = 3 + strlen(name)/4 + 1 or
322 auto linkageName = spirv::decodeStringLiteral(words, wordIndex).str();
324 static_cast<::mlir::spirv::LinkageType>(words[wordIndex++]));
327 decorations[words[0]].set(symbol, llvm::dyn_cast<Attribute>(linkageAttr));
345 if (words.size() != 2) {
353 decorations[words[0]].set(symbol, opBuilder.getUnitAttr());
357 if (words.size() != 3) {
361 decorations[words[0]].set(
362 symbol, opBuilder.getI32IntegerAttr(static_cast<int32_t>(words[2])));
367 unknownLoc, opBuilder, decorations, words, symbol, decorationName,
376 unknownLoc, opBuilder, decorations, words, symbol, decorationName,
389 spirv::Deserializer::processMemberDecoration(ArrayRef<uint32_t> words) {
391 if (words.size() < 3) {
396 auto decoration = static_cast<spirv::Decoration>(words[2]);
397 if (decoration == spirv::Decoration::Offset && words.size() != 4) {
403 if (words.size() > 3) {
404 decorationOperands = words.slice(3);
406 memberDecorationMap[words[0]][words[1]][decoration] = decorationOperands;
410 LogicalResult spirv::Deserializer::processMemberName(ArrayRef<uint32_t> words) {
411 if (words.size() < 3) {
415 auto name = decodeStringLiteral(words, wordIndex);
416 if (wordIndex != words.size()) {
418 "unexpected trailing words in OpMemberName instruction");
420 memberNameMap[words[0]][words[1]] = name;
802 "unexpected trailing words in OpName instruction");
1321 // 64-bit integers are represented with two SPIR-V words. According to
1323 // literal’s low-order words appear first."
1327 } words = {operands[2], operands[3]};
1328 value = APInt(64, llvm::bit_cast<uint64_t>(words), /*isSigned=*/true);
1355 // Double values are represented with two SPIR-V words. According to
1357 // literal’s low-order words appear first."
1361 } words = {operands[2], operands[3]};
1362 value = APFloat(llvm::bit_cast<double>(words));
2261 "unexpected trailing words in OpString instruction");