Lines Matching full:operand
12 // custom operand parsing.
54 // 1. Classification: Each operand is mapped to the unique set which (a)
75 // Custom Operand Parsing
81 // instructions. The target specific custom operand parsing works in the
84 // 1. A operand match table is built, each entry contains a mnemonic, an
85 // operand class, a mask for all operand positions for that same
88 // 2. The operand matcher will try every possible entry with the same
90 // matches. After that, if the operand to be matched has its index
92 // to the regular operand parsing.
94 // 3. For a match success, each operand class that has a 'ParserMethod'
159 /// is the literal token string, for an operand it is the TableGen class (or
163 /// PredicateMethod - The name of the operand method to test whether the
164 /// operand matches this class; this is not valid for Token or register kinds.
167 /// RenderMethod - The name of the operand method to add this operand to an
171 /// ParserMethod - The name of the operand method to do a target specific
172 /// parsing on the operand.
278 /// Token - This is the token that the operand came from.
281 /// The unique class instance this operand should match.
284 /// The operand name this is, if anything.
287 /// The suboperand index within SrcOpName, or -1 for the entire operand.
293 /// ResOperand - This represents a single operand in the result instruction
295 /// assembler operand expands to multiple MCOperands, this represents the
296 /// single assembler operand, not the MCOperand.
299 /// RenderAsmOperand - This represents an operand result that is
300 /// generated by calling the render method on the assembly operand. The
304 /// TiedOperand - This represents a result operand that is a duplicate of
305 /// a previous result operand.
309 /// the operand.
317 /// This is the operand # in the AsmOperands list that this should be
321 /// TiedOperandNum - This is the (earlier) result operand that should be
333 /// operand.
382 /// ResOperands - This is the operand list that should be built for the result
459 // Compare lexicographically by operand. The matcher validates that other
484 // by checking that either (a) a token or operand kind discriminates them,
487 // Tokens and operand kinds are unambiguous (assuming a correct target
496 // Otherwise, this operand could commute if all operands are equivalent, or
592 /// getOperandClass - Lookup or create the class for the given operand.
601 /// operand classes.
618 /// defined operand parsing methods.
622 /// given operand.
715 assert(End != String.end() && "Missing brace in operand reference!");
745 // Remove the first operand, it is tracked in the mnemonic field.
769 // Reject matchables with operand modifiers, these aren't something we can
773 // Also, check for instructions which reference the operand multiple times;
780 "matchable with operand modifier '" + Tok.str() +
783 // Verify that any operand is only mentioned once.
788 "ERROR: matchable with tied operand '" + Tok.str() +
794 << "ignoring instruction with tied operand '"
905 assert(Rec->isSubClassOf("Operand") && "Unexpected operand!");
910 throw TGError(Rec->getLoc(), "operand has no match class!");
1110 /// defined operand parsing methods.
1133 // Generate operand match info for each mnemonic/operand class pair.
1179 // Validate the operand list to ensure we can handle this instruction.
1185 // If we have a tied operand that consists of multiple MCOperands,
1192 << "ignoring instruction with multi-operand tied operand '"
1246 // Build info for the user defined assembly operand classes.
1281 // Otherwise this is an operand reference.
1304 /// BuildInstructionOperandReference - The specified operand is a reference to a
1305 /// named operand such as $src. Resolve the Class and OperandInfo pointers.
1314 // Map this token to an operand.
1317 throw TGError(II->TheDef->getLoc(), "error: unable to find operand: '" +
1320 // If the instruction operand has multiple suboperands, but the parser
1321 // match class for the asm operand is still the default "ImmAsmOperand",
1325 assert(Rec->isSubClassOf("Operand") && "Unexpected operand!");
1341 // Set up the operand class.
1344 // If the named operand is tied, canonicalize it to the untied operand.
1351 // so that we know how to provide the $dst operand when filling in the result.
1354 // The tied operand index is an MIOperand index, find the operand
1364 /// BuildAliasOperandReference - When parsing an operand reference out of the
1366 /// operand reference is by looking it up in the result pattern definition.
1372 // Set up the operand class.
1386 throw TGError(II->TheDef->getLoc(), "error: unable to find operand: '" +
1398 // If this is a tied operand, just copy from the previously handled operand.
1405 // Find out what operand from the asmparser this MCInst operand comes from.
1409 TheDef->getName() + "' has operand '" + OpInfo.Name +
1412 // Check if the one AsmOperand populates the entire operand.
1440 // If this is a tied operand, just copy from the previously handled operand.
1447 // Handle all the suboperands for this operand.
1453 // Find out what operand from the asmparser that this MCInst operand
1456 default: assert(0 && "unexpected InstAlias operand kind");
1462 TheDef->getName() + "' has operand '" + OpName +
1510 // TargetOperandClass - This is the target's operand class, like X86Operand.
1511 std::string TargetOperandClass = Target.getName() + "Operand";
1546 // Generate code to populate each result operand.
1569 // If this operand is tied to a previous one, just copy the MCInst
1570 // operand from the earlier one.We can only tie single MCOperand values.
1573 assert(i > TiedOp && "Tied operand precedes its target!");
1656 /// EmitValidateOperandClass - Emit the function to validate an operand class.
1661 OS << " " << Info.Target.getName() << "Operand &Operand = *("
1662 << Info.Target.getName() << "Operand*)GOp;\n";
1664 // The InvalidMatchClass is not to match any operand.
1669 OS << " if (Operand.isToken())\n";
1670 OS << " return MatchTokenString(Operand.getToken()) == Kind;\n\n";
1673 OS << " if (Operand.isReg()) {\n";
1675 OS << " switch (Operand.getReg()) {\n";
1698 << " && Operand." << CI.PredicateMethod << "()) {\n";
1989 // Emit the static custom operand parsing table;
2017 OS << " /* Mnemonic, Operand List Mask, Operand Class, Features */\n";
2053 // Emit the operand class switch to call the correct custom parser for
2054 // the found operand class.
2076 // Emit the static custom operand parser. This code is very similar with
2088 OS << " // Get the next operand index.\n";
2115 // Emit check to ensure the operand number matches.
2116 OS << " // check if the operand in question has a custom parser.\n";
2121 OS << " // call custom parse method to handle the operand\n";
2178 // Compute the information on the custom operand parsing.
2202 OS << " MatchOperand_Success, // operand matched successfully\n";
2203 OS << " MatchOperand_NoMatch, // operand did not match\n";
2204 OS << " MatchOperand_ParseFail // operand matched but had errors\n";
2247 // Emit the routine to validate an operand against a match class.
2353 << "Operand*)Operands[0])->getToken();\n\n";
2360 // Emit code to compute the class list for this operand vector.
2371 OS << " // Set ErrorInfo to the operand that mismatches if it is\n";
2402 OS << " // If this operand is broken for all of the instances of this\n";