Lines Matching refs:spv
44 namespace spv {
81 namespace spv {
109 namespace spv {
115 …spirvbin_t(int verbose = 0) : entryPoint(spv::NoResult), largestNewId(0), verbose(verbose), errorL… in entryPoint()
121 void remap(std::vector<std::uint32_t>& spv, std::uint32_t opts = DO_EVERYTHING);
137 typedef std::unordered_map<spv::Id, spv::Id> idmap_t;
138 typedef std::unordered_set<spv::Id> idset_t;
139 typedef std::unordered_map<spv::Id, int> blockmap_t;
144 typedef std::unordered_map<std::string, spv::Id> namemap_t;
149 typedef std::function<void(spv::Id&)> idfn_t;
150 typedef std::function<bool(spv::Op, unsigned start)> instfn_t;
153 static const spv::Id unmapped; // unchanged from default value
154 static const spv::Id unused; // unused ID
161 typedef std::map<spv::Id, typeentry_t> globaltypes_t;
165 typedef std::unordered_map<spv::Id, int> posmap_rev_t;
168 typedef std::unordered_map<spv::Id, unsigned> typesize_map_t;
173 bool isConstOp(spv::Op opCode) const;
174 bool isTypeOp(spv::Op opCode) const;
175 bool isStripOp(spv::Op opCode) const;
176 bool isFlowCtrl(spv::Op opCode) const;
177 range_t literalRange(spv::Op opCode) const;
178 range_t typeRange(spv::Op opCode) const;
179 range_t constRange(spv::Op opCode) const;
180 unsigned typeSizeInWords(spv::Id id) const;
181 unsigned idTypeSizeInWords(spv::Id id) const;
183 spv::Id& asId(unsigned word) { return spv[word]; } in asId()
184 const spv::Id& asId(unsigned word) const { return spv[word]; } in asId()
185 spv::Op asOpCode(unsigned word) const { return opOpCode(spv[word]); } in asOpCode()
187 spv::Decoration asDecoration(unsigned word) const { return spv::Decoration(spv[word]); } in asDecoration()
188 unsigned asWordCount(unsigned word) const { return opWordCount(spv[word]); } in asWordCount()
189 …spv::Id asTypeConstId(unsigned word) const { return asId(word + (isTypeOp(asOpCode(word)) … in asTypeConstId()
190 unsigned idPos(spv::Id id) const;
192 static unsigned opWordCount(spirword_t data) { return data >> spv::WordCountShift; } in opWordCount()
193 static spv::Op opOpCode(spirword_t data) { return spv::Op(data & spv::OpCodeMask); } in opOpCode()
196 spirword_t magic() const { return spv[0]; } // return magic number in magic()
197 spirword_t bound() const { return spv[3]; } // return Id bound from header in bound()
198 spirword_t bound(spirword_t b) { return spv[3] = b; }; in bound()
199 spirword_t genmagic() const { return spv[2]; } // generator magic in genmagic()
200 spirword_t genmagic(spirword_t m) { return spv[2] = m; } in genmagic()
201 spirword_t schemaNum() const { return spv[4]; } // schema number from header in schemaNum()
204 spv::Id localId(spv::Id id) const { return idMapL[id]; } in localId()
207 inline spv::Id localId(spv::Id id, spv::Id newId);
208 void countIds(spv::Id id);
213 inline spv::Id nextUnusedId(spv::Id id);
219 bool isNewIdMapped(spv::Id newId) const { return isMapped(newId); } in isNewIdMapped()
220 bool isOldIdUnmapped(spv::Id oldId) const { return localId(oldId) == unmapped; } in isOldIdUnmapped()
221 bool isOldIdUnused(spv::Id oldId) const { return localId(oldId) == unused; } in isOldIdUnused()
222 …bool isOldIdMapped(spv::Id oldId) const { return !isOldIdUnused(oldId) && !isOldIdUnmapped(oldId… in isOldIdMapped()
223 bool isFunction(spv::Id oldId) const { return fnPos.find(oldId) != fnPos.end(); } in isFunction()
250 std::vector<spirword_t> spv; // SPIR words variable
260 …bool isMapped(spv::Id id) const { return id < maxMappedId() && ((mapped[id/mBits] & (1LL<<(id%mBi… in isMapped()
261 void setMapped(spv::Id id) { resizeMapped(id); mapped[id/mBits] |= (1LL<<(id%mBits)); } in setMapped()
262 void resizeMapped(spv::Id id) { if (id >= maxMappedId()) mapped.resize(id/mBits+1, 0); } in resizeMapped()
271 std::unordered_map<spv::Id, range_t> fnPos;
274 std::unordered_map<spv::Id, int> fnCalls;
280 std::vector<spv::Id> idMapL; // ID {M}ap from {L}ocal to {G}lobal IDs
282 spv::Id entryPoint; // module entry point
283 spv::Id largestNewId; // biggest new ID we have mapped anything to