4311 char *token; // Identifier which may be opcode or operand
4312
4313 // Match expression starts with a '('
4314 if (cur_char() != '(')
4315 return NULL;
4316
4317 next_char(); // advance past '('
4318
4319 // Parse the opcode
4320 token = get_ident(); // Get identifier, opcode
4321 if (token == NULL) {
4322 parse_err(SYNERR, "missing opcode in match expression\n");
4323 return NULL;
4324 }
4325
4326 // Take note if we see one of a few special operations - those that are
4327 // treated differently on different architectures in the sense that on
4328 // one architecture there is a match rule and on another there isn't (so
4329 // a call will eventually be generated).
4330
4331 for (int i = _last_machine_leaf + 1; i < _last_opcode; i++) {
4332 if (strcmp(token, NodeClassNames[i]) == 0) {
4333 _AD.has_match_rule(i, true);
4334 }
4335 }
4336
4337 // Lookup the root value in the operands dict to perform substitution
4338 const char *result = NULL; // Result type will be filled in later
4339 const char *name = token; // local name associated with this node
4340 const char *operation = token; // remember valid operation for later
4341 const Form *form = operands[token];
4342 OpClassForm *opcForm = form ? form->is_opclass() : NULL;
4343 if (opcForm != NULL) {
4344 // If this token is an entry in the local names table, record its type
4345 if (!opcForm->ideal_only()) {
4346 operation = opcForm->_ident;
4347 result = operation; // Operands result in their own type
4348 }
4349 // Otherwise it is an ideal type, and so, has no local name
4350 else name = NULL;
4351 }
|
4311 char *token; // Identifier which may be opcode or operand
4312
4313 // Match expression starts with a '('
4314 if (cur_char() != '(')
4315 return NULL;
4316
4317 next_char(); // advance past '('
4318
4319 // Parse the opcode
4320 token = get_ident(); // Get identifier, opcode
4321 if (token == NULL) {
4322 parse_err(SYNERR, "missing opcode in match expression\n");
4323 return NULL;
4324 }
4325
4326 // Take note if we see one of a few special operations - those that are
4327 // treated differently on different architectures in the sense that on
4328 // one architecture there is a match rule and on another there isn't (so
4329 // a call will eventually be generated).
4330
4331 for (uint i = static_cast<uint>(Opcodes::_last_machine_leaf) + 1;
4332 i < static_cast<uint>(Opcodes::_last_opcode); i++) {
4333 if (strcmp(token, NodeClassNames[i]) == 0) {
4334 _AD.has_match_rule(i, true);
4335 }
4336 }
4337
4338 // Lookup the root value in the operands dict to perform substitution
4339 const char *result = NULL; // Result type will be filled in later
4340 const char *name = token; // local name associated with this node
4341 const char *operation = token; // remember valid operation for later
4342 const Form *form = operands[token];
4343 OpClassForm *opcForm = form ? form->is_opclass() : NULL;
4344 if (opcForm != NULL) {
4345 // If this token is an entry in the local names table, record its type
4346 if (!opcForm->ideal_only()) {
4347 operation = opcForm->_ident;
4348 result = operation; // Operands result in their own type
4349 }
4350 // Otherwise it is an ideal type, and so, has no local name
4351 else name = NULL;
4352 }
|