void STORE(Type type, Register offset, AddressSpace space, bool dwAligned, BTI bti, Args...values) { const Tuple index = this->tuple(values...); const uint16_t valueNum = std::tuple_size<std::tuple<Args...>>::value; GBE_ASSERT(valueNum > 0); this->STORE(type, index, offset, space, valueNum, dwAligned, bti); }
void foreach(const T &functor) { // Iterate on all blocks for (Info::iterator pair = liveness.begin(); pair != liveness.end(); ++pair) { BlockInfo &info = *(pair->second); const BasicBlock &bb = info.bb; const BlockSet *set = NULL; if (dir == DF_SUCC) set = &bb.getSuccessorSet(); else set = &bb.getPredecessorSet(); // Iterate over all successors for (BlockSet::iterator other = (*set).begin(); other != (*set).end(); ++other) { Info::iterator otherInfo = liveness.find(*other); GBE_ASSERT(otherInfo != liveness.end() && otherInfo->second != NULL); functor(info, *otherInfo->second); } } }
std::ostream &operator<< (std::ostream &out, const Type &type) { switch (type) { case TYPE_BOOL: return out << "bool"; case TYPE_S8: return out << "int8"; case TYPE_U8: return out << "uint8"; case TYPE_S16: return out << "int16"; case TYPE_U16: return out << "uin16"; case TYPE_S32: return out << "int32"; case TYPE_U32: return out << "uin32"; case TYPE_S64: return out << "int64"; case TYPE_U64: return out << "uin64"; case TYPE_HALF: return out << "half"; case TYPE_FLOAT: return out << "float"; case TYPE_DOUBLE: return out << "double"; default : GBE_ASSERT(0 && "Unsupported type\n"); }; return out; }
/*! Get the special register */ INLINE Register getSpecialReg(void) const { GBE_ASSERT(type == DEF_SPECIAL_REG); return Register(data.regID); }
/*! Get the pushed location */ INLINE const PushLocation *getPushLocation(void) const { GBE_ASSERT(type == DEF_FN_PUSHED); return data.pushed; }
/*! Get the function input (only if this is a function argument) */ INLINE const FunctionArgument *getFunctionArgument(void) const { GBE_ASSERT(type == DEF_FN_ARG); return data.arg; }
/*! Get the destination ID (only if this is a instruction value) */ INLINE uint32_t getDstID(void) const { GBE_ASSERT(type == DEF_INSN_DST); return data.dstID; }
/*! Get the instruction (only if this is a instruction value) */ INLINE const Instruction *getInstruction(void) const { GBE_ASSERT(type == DEF_INSN_DST); return data.insn; }
/*! Get the target label index for the given instruction */ INLINE ir::LabelIndex getLabelIndex(const ir::Instruction *insn) const { GBE_ASSERT(JIPs.find(insn) != JIPs.end()); return JIPs.find(insn)->second; }
/*! Return the complete block info */ INLINE const BlockInfo &getBlockInfo(const BasicBlock *bb) const { auto it = liveness.find(bb); GBE_ASSERT(it != liveness.end() && it->second != NULL); return *it->second; }
/*! Set the SIMD width of the function */ void setSimdWidth(uint32_t width) const { GBE_ASSERT(width == 8 || width == 16); fn->simdWidth = width; }