2265
2266
2267 bool OperandForm::is_bound_register() const {
2268 RegClass* reg_class = get_RegClass();
2269 if (reg_class == NULL) {
2270 return false;
2271 }
2272
2273 const char* name = ideal_type(globalAD->globalNames());
2274 if (name == NULL) {
2275 return false;
2276 }
2277
2278 uint size = 0;
2279 if (strcmp(name, "RegFlags") == 0) size = 1;
2280 if (strcmp(name, "RegI") == 0) size = 1;
2281 if (strcmp(name, "RegF") == 0) size = 1;
2282 if (strcmp(name, "RegD") == 0) size = 2;
2283 if (strcmp(name, "RegL") == 0) size = 2;
2284 if (strcmp(name, "RegN") == 0) size = 1;
2285 if (strcmp(name, "RegP") == 0) size = globalAD->get_preproc_def("_LP64") ? 2 : 1;
2286 if (size == 0) {
2287 return false;
2288 }
2289 return size == reg_class->size();
2290 }
2291
2292
2293 // Check if this is a valid field for this operand,
2294 // Return 'true' if valid, and set the value to the string the user provided.
2295 bool OperandForm::is_interface_field(const char *field,
2296 const char * &value) const {
2297 return false;
2298 }
2299
2300
2301 // Return register class name if a constraint specifies the register class.
2302 const char *OperandForm::constrained_reg_class() const {
2303 const char *reg_class = NULL;
2304 if ( _constraint ) {
3492 }
3493 }
3494
3495 int MatchNode::needs_ideal_memory_edge(FormDict &globals) const {
3496 static const char *needs_ideal_memory_list[] = {
3497 "StoreI","StoreL","StoreP","StoreN","StoreNKlass","StoreD","StoreF" ,
3498 "StoreB","StoreC","Store" ,"StoreFP",
3499 "LoadI", "LoadL", "LoadP" ,"LoadN", "LoadD" ,"LoadF" ,
3500 "LoadB" , "LoadUB", "LoadUS" ,"LoadS" ,"Load" ,
3501 "StoreVector", "LoadVector",
3502 "LoadRange", "LoadKlass", "LoadNKlass", "LoadL_unaligned", "LoadD_unaligned",
3503 "LoadPLocked",
3504 "StorePConditional", "StoreIConditional", "StoreLConditional",
3505 "CompareAndSwapB", "CompareAndSwapS", "CompareAndSwapI", "CompareAndSwapL", "CompareAndSwapP", "CompareAndSwapN",
3506 "WeakCompareAndSwapB", "WeakCompareAndSwapS", "WeakCompareAndSwapI", "WeakCompareAndSwapL", "WeakCompareAndSwapP", "WeakCompareAndSwapN",
3507 "CompareAndExchangeB", "CompareAndExchangeS", "CompareAndExchangeI", "CompareAndExchangeL", "CompareAndExchangeP", "CompareAndExchangeN",
3508 "StoreCM",
3509 "ClearArray",
3510 "GetAndSetB", "GetAndSetS", "GetAndAddI", "GetAndSetI", "GetAndSetP",
3511 "GetAndAddB", "GetAndAddS", "GetAndAddL", "GetAndSetL", "GetAndSetN",
3512 };
3513 int cnt = sizeof(needs_ideal_memory_list)/sizeof(char*);
3514 if( strcmp(_opType,"PrefetchAllocation")==0 )
3515 return 1;
3516 if( _lChild ) {
3517 const char *opType = _lChild->_opType;
3518 for( int i=0; i<cnt; i++ )
3519 if( strcmp(opType,needs_ideal_memory_list[i]) == 0 )
3520 return 1;
3521 if( _lChild->needs_ideal_memory_edge(globals) )
3522 return 1;
3523 }
3524 if( _rChild ) {
3525 const char *opType = _rChild->_opType;
3526 for( int i=0; i<cnt; i++ )
3527 if( strcmp(opType,needs_ideal_memory_list[i]) == 0 )
3528 return 1;
3529 if( _rChild->needs_ideal_memory_edge(globals) )
3530 return 1;
3531 }
|
2265
2266
2267 bool OperandForm::is_bound_register() const {
2268 RegClass* reg_class = get_RegClass();
2269 if (reg_class == NULL) {
2270 return false;
2271 }
2272
2273 const char* name = ideal_type(globalAD->globalNames());
2274 if (name == NULL) {
2275 return false;
2276 }
2277
2278 uint size = 0;
2279 if (strcmp(name, "RegFlags") == 0) size = 1;
2280 if (strcmp(name, "RegI") == 0) size = 1;
2281 if (strcmp(name, "RegF") == 0) size = 1;
2282 if (strcmp(name, "RegD") == 0) size = 2;
2283 if (strcmp(name, "RegL") == 0) size = 2;
2284 if (strcmp(name, "RegN") == 0) size = 1;
2285 if (strcmp(name, "VecX") == 0) size = 4;
2286 if (strcmp(name, "VecY") == 0) size = 8;
2287 if (strcmp(name, "VecZ") == 0) size = 16;
2288 if (strcmp(name, "RegP") == 0) size = globalAD->get_preproc_def("_LP64") ? 2 : 1;
2289 if (size == 0) {
2290 return false;
2291 }
2292 return size == reg_class->size();
2293 }
2294
2295
2296 // Check if this is a valid field for this operand,
2297 // Return 'true' if valid, and set the value to the string the user provided.
2298 bool OperandForm::is_interface_field(const char *field,
2299 const char * &value) const {
2300 return false;
2301 }
2302
2303
2304 // Return register class name if a constraint specifies the register class.
2305 const char *OperandForm::constrained_reg_class() const {
2306 const char *reg_class = NULL;
2307 if ( _constraint ) {
3495 }
3496 }
3497
3498 int MatchNode::needs_ideal_memory_edge(FormDict &globals) const {
3499 static const char *needs_ideal_memory_list[] = {
3500 "StoreI","StoreL","StoreP","StoreN","StoreNKlass","StoreD","StoreF" ,
3501 "StoreB","StoreC","Store" ,"StoreFP",
3502 "LoadI", "LoadL", "LoadP" ,"LoadN", "LoadD" ,"LoadF" ,
3503 "LoadB" , "LoadUB", "LoadUS" ,"LoadS" ,"Load" ,
3504 "StoreVector", "LoadVector",
3505 "LoadRange", "LoadKlass", "LoadNKlass", "LoadL_unaligned", "LoadD_unaligned",
3506 "LoadPLocked",
3507 "StorePConditional", "StoreIConditional", "StoreLConditional",
3508 "CompareAndSwapB", "CompareAndSwapS", "CompareAndSwapI", "CompareAndSwapL", "CompareAndSwapP", "CompareAndSwapN",
3509 "WeakCompareAndSwapB", "WeakCompareAndSwapS", "WeakCompareAndSwapI", "WeakCompareAndSwapL", "WeakCompareAndSwapP", "WeakCompareAndSwapN",
3510 "CompareAndExchangeB", "CompareAndExchangeS", "CompareAndExchangeI", "CompareAndExchangeL", "CompareAndExchangeP", "CompareAndExchangeN",
3511 "StoreCM",
3512 "ClearArray",
3513 "GetAndSetB", "GetAndSetS", "GetAndAddI", "GetAndSetI", "GetAndSetP",
3514 "GetAndAddB", "GetAndAddS", "GetAndAddL", "GetAndSetL", "GetAndSetN",
3515 "LoadBarrierSlowReg", "LoadBarrierWeakSlowReg"
3516 };
3517 int cnt = sizeof(needs_ideal_memory_list)/sizeof(char*);
3518 if( strcmp(_opType,"PrefetchAllocation")==0 )
3519 return 1;
3520 if( _lChild ) {
3521 const char *opType = _lChild->_opType;
3522 for( int i=0; i<cnt; i++ )
3523 if( strcmp(opType,needs_ideal_memory_list[i]) == 0 )
3524 return 1;
3525 if( _lChild->needs_ideal_memory_edge(globals) )
3526 return 1;
3527 }
3528 if( _rChild ) {
3529 const char *opType = _rChild->_opType;
3530 for( int i=0; i<cnt; i++ )
3531 if( strcmp(opType,needs_ideal_memory_list[i]) == 0 )
3532 return 1;
3533 if( _rChild->needs_ideal_memory_edge(globals) )
3534 return 1;
3535 }
|