예제 #1
0
 virtual Inst parseInstMnemo(const string& prefix, Scanner& scanner, Brigantine& bw, int* vx) const
 {
     Inst res = GenericExtension::parseInstMnemo(prefix, scanner, bw, vx);
     const ExtInstDesc* desc = getInstDesc(res.opcode());
     if (desc->parser == parseMnemoBasicNoType) res.type() = BRIG_TYPE_B32;
     return res;
 }
예제 #2
0
    virtual string getMnemo(Inst inst) const
    {
        assert(inst);
        unsigned opcode = inst.opcode();
        const ExtInstDesc* desc = getInstDesc(opcode);

        if (opcode == BRIG_OPCODE_AMD_GCN_APPEND || opcode == BRIG_OPCODE_AMD_GCN_CONSUME)
        {
            return string(desc->name) + "_" + type2str(inst.type());
        }
        else if (desc->parser == parseMnemoBasicNoType)
        {
            return string(desc->name);
        }
        else
        {
            return "";
        }
    }
예제 #3
0
template <typename Visitor> void enumerateFields_gen(Inst obj,  Visitor & vis) {
  enumerateFields_gen(Code(obj), vis);
  vis(obj.opcode(),"opcode");
  vis(obj.type(),"type");
  vis(obj.operands(),"operands");
}