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; }
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 ""; } }
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"); }