equal
deleted
inserted
replaced
243 check_optype(op->_matrule); |
243 check_optype(op->_matrule); |
244 |
244 |
245 // Construct chain rules |
245 // Construct chain rules |
246 build_chain_rule(op); |
246 build_chain_rule(op); |
247 |
247 |
248 MatchRule &mrule = *op->_matrule; |
248 MatchRule *mrule = op->_matrule; |
249 Predicate *pred = op->_predicate; |
249 Predicate *pred = op->_predicate; |
250 |
250 |
251 // Grab the machine type of the operand |
251 // Grab the machine type of the operand |
252 const char *rootOp = op->_ident; |
252 const char *rootOp = op->_ident; |
253 mrule._machType = rootOp; |
253 mrule->_machType = rootOp; |
254 |
254 |
255 // Check for special cases |
255 // Check for special cases |
256 if (strcmp(rootOp,"Universe")==0) continue; |
256 if (strcmp(rootOp,"Universe")==0) continue; |
257 if (strcmp(rootOp,"label")==0) continue; |
257 if (strcmp(rootOp,"label")==0) continue; |
258 // !!!!! !!!!! |
258 // !!!!! !!!!! |
269 ((AttributeForm*)_globalNames[AttributeForm::_op_cost])->_attrdef; |
269 ((AttributeForm*)_globalNames[AttributeForm::_op_cost])->_attrdef; |
270 const char *cost = costStr? costStr : defaultCost; |
270 const char *cost = costStr? costStr : defaultCost; |
271 |
271 |
272 // Find result type for match. |
272 // Find result type for match. |
273 const char *result = op->reduce_result(); |
273 const char *result = op->reduce_result(); |
274 bool has_root = false; |
274 |
275 |
275 // Construct a MatchList for this entry. |
276 // Construct a MatchList for this entry |
276 // Iterate over the list to enumerate all match cases for operands with multiple match rules. |
277 buildMatchList(op->_matrule, result, rootOp, pred, cost); |
277 for (; mrule != NULL; mrule = mrule->_next) { |
|
278 mrule->_machType = rootOp; |
|
279 buildMatchList(mrule, result, rootOp, pred, cost); |
|
280 } |
278 } |
281 } |
279 } |
282 } |
280 |
283 |
281 // Build MatchList structures for instructions |
284 // Build MatchList structures for instructions |
282 void ArchDesc::inspectInstructions() { |
285 void ArchDesc::inspectInstructions() { |