示例#1
0
文件: nv50_ir.cpp 项目: dumbbell/mesa
bool
LValue::isUniform() const
{
   if (defs.size() > 1)
      return false;
   Instruction *insn = getInsn();
   // let's not try too hard here for now ...
   return !insn->srcExists(1) && insn->getSrc(0)->isUniform();
}
示例#2
0
void Bytecode::dump(ostream& out) const {
    for (size_t bci = 0; bci < length();) {
        size_t length;
        Instruction insn = getInsn(bci);
        out << bci << ": ";
        const char* name = bcName(insn, length);
        switch (insn) {
            case BC_DLOAD:
                out << name << " " << getDouble(bci + 1);
                break;
            case BC_ILOAD:
                out << name << " " << getInt64(bci + 1);
                break;
            case BC_SLOAD:
                out << name << " @" << getUInt16(bci + 1);
                break;
            case BC_CALL:
            case BC_CALLNATIVE:
                out << name << " *" << getUInt16(bci + 1);
                break;
            case BC_LOADDVAR:
            case BC_STOREDVAR:
            case BC_LOADIVAR:
            case BC_STOREIVAR:
            case BC_LOADSVAR:
            case BC_STORESVAR:
                out << name << " @" << getUInt16(bci + 1);
                break;
            case BC_LOADCTXDVAR:
            case BC_STORECTXDVAR:
            case BC_LOADCTXIVAR:
            case BC_STORECTXIVAR:
            case BC_LOADCTXSVAR:
            case BC_STORECTXSVAR:
                out << name << " @" << getUInt16(bci + 1)
                    << ":" << getUInt16(bci + 3);
                break;
            case BC_IFICMPNE:
            case BC_IFICMPE:
            case BC_IFICMPG:
            case BC_IFICMPGE:
            case BC_IFICMPL:
            case BC_IFICMPLE:
            case BC_JA:
                out << name << " " << getInt16(bci + 1) + bci + 1;
                break;
          default:
                out << name;
        }
        out << endl;
        bci += length;
    }
}