13 #ifndef MLIR_TARGET_SPIRV_SPIRVBINARYUTILS_H
14 #define MLIR_TARGET_SPIRV_SPIRVBINARYUTILS_H
36 spirv::Version version, uint32_t idBound);
48 unsigned &wordIndex) {
49 StringRef str(
reinterpret_cast<const char *
>(words.data() + wordIndex));
50 wordIndex += str.size() / 4 + 1;
void encodeStringLiteralInto(SmallVectorImpl< uint32_t > &binary, StringRef literal)
Encodes an SPIR-V literal string into the given binary vector.
constexpr uint32_t kGeneratorNumber
The serializer tool ID registered to the Khronos Group.
constexpr uint32_t kMagicNumber
SPIR-V magic number.
uint32_t getPrefixedOpcode(uint32_t wordCount, spirv::Opcode opcode)
Returns the word-count-prefixed opcode for an SPIR-V instruction.
void appendModuleHeader(SmallVectorImpl< uint32_t > &header, spirv::Version version, uint32_t idBound)
Appends a SPRI-V module header to header with the given version and idBound.
StringRef decodeStringLiteral(ArrayRef< uint32_t > words, unsigned &wordIndex)
Decodes a string literal in words starting at wordIndex.
constexpr unsigned kHeaderWordCount
SPIR-V binary header word count.
Include the generated interface declarations.