2241 RegClass* OperandForm::get_RegClass() const {
2242 if (_interface && !_interface->is_RegInterface()) return NULL;
2243 return globalAD->get_registers()->getRegClass(constrained_reg_class());
2244 }
2245
2246
2247 bool OperandForm::is_bound_register() const {
2248 RegClass* reg_class = get_RegClass();
2249 if (reg_class == NULL) {
2250 return false;
2251 }
2252
2253 const char* name = ideal_type(globalAD->globalNames());
2254 if (name == NULL) {
2255 return false;
2256 }
2257
2258 uint size = 0;
2259 if (strcmp(name, "RegFlags") == 0) size = 1;
2260 if (strcmp(name, "RegI") == 0) size = 1;
2261 if (strcmp(name, "RegF") == 0) size = 1;
2262 if (strcmp(name, "RegD") == 0) size = 2;
2263 if (strcmp(name, "RegL") == 0) size = 2;
2264 if (strcmp(name, "RegN") == 0) size = 1;
2265 if (strcmp(name, "RegP") == 0) size = globalAD->get_preproc_def("_LP64") ? 2 : 1;
2266 if (size == 0) {
2267 return false;
2268 }
2269 return size == reg_class->size();
2270 }
2271
2272
2273 // Check if this is a valid field for this operand,
2274 // Return 'true' if valid, and set the value to the string the user provided.
2275 bool OperandForm::is_interface_field(const char *field,
2276 const char * &value) const {
2277 return false;
2278 }
2279
2280
3897 const char * &opType)const{
3898 uint position = position0;
3899
3900 return (MatchNode::base_operand( position, globals, result, name, opType));
3901 }
3902
3903
3904 bool MatchRule::is_base_register(FormDict &globals) const {
3905 uint position = 1;
3906 const char *result = NULL;
3907 const char *name = NULL;
3908 const char *opType = NULL;
3909 if (!base_operand(position, globals, result, name, opType)) {
3910 position = 0;
3911 if( base_operand(position, globals, result, name, opType) &&
3912 (strcmp(opType,"RegI")==0 ||
3913 strcmp(opType,"RegP")==0 ||
3914 strcmp(opType,"RegN")==0 ||
3915 strcmp(opType,"RegL")==0 ||
3916 strcmp(opType,"RegF")==0 ||
3917 strcmp(opType,"RegD")==0 ||
3918 strcmp(opType,"VecS")==0 ||
3919 strcmp(opType,"VecD")==0 ||
3920 strcmp(opType,"VecX")==0 ||
3921 strcmp(opType,"VecY")==0 ||
3922 strcmp(opType,"Reg" )==0) ) {
3923 return 1;
3924 }
3925 }
3926 return 0;
3927 }
3928
3929 Form::DataType MatchRule::is_base_constant(FormDict &globals) const {
3930 uint position = 1;
3931 const char *result = NULL;
3932 const char *name = NULL;
3933 const char *opType = NULL;
3934 if (!base_operand(position, globals, result, name, opType)) {
3935 position = 0;
3936 if (base_operand(position, globals, result, name, opType)) {
3937 return ideal_to_const_type(opType);
3938 }
3939 }
3940 return Form::none;
3941 }
4122 }
4123 return false;
4124 }
4125
4126
4127 Form::DataType MatchRule::is_ideal_load() const {
4128 Form::DataType ideal_load = Form::none;
4129
4130 if ( _opType && (strcmp(_opType,"Set") == 0) && _rChild ) {
4131 const char *opType = _rChild->_opType;
4132 ideal_load = is_load_from_memory(opType);
4133 }
4134
4135 return ideal_load;
4136 }
4137
4138 bool MatchRule::is_vector() const {
4139 static const char *vector_list[] = {
4140 "AddVB","AddVS","AddVI","AddVL","AddVF","AddVD",
4141 "SubVB","SubVS","SubVI","SubVL","SubVF","SubVD",
4142 "MulVS","MulVI","MulVF","MulVD",
4143 "DivVF","DivVD",
4144 "AndV" ,"XorV" ,"OrV",
4145 "AddReductionVI", "AddReductionVL",
4146 "AddReductionVF", "AddReductionVD",
4147 "MulReductionVI",
4148 "MulReductionVF", "MulReductionVD",
4149 "LShiftCntV","RShiftCntV",
4150 "LShiftVB","LShiftVS","LShiftVI","LShiftVL",
4151 "RShiftVB","RShiftVS","RShiftVI","RShiftVL",
4152 "URShiftVB","URShiftVS","URShiftVI","URShiftVL",
4153 "ReplicateB","ReplicateS","ReplicateI","ReplicateL","ReplicateF","ReplicateD",
4154 "LoadVector","StoreVector",
4155 // Next are not supported currently.
4156 "PackB","PackS","PackI","PackL","PackF","PackD","Pack2L","Pack2D",
4157 "ExtractB","ExtractUB","ExtractC","ExtractS","ExtractI","ExtractL","ExtractF","ExtractD"
4158 };
4159 int cnt = sizeof(vector_list)/sizeof(char*);
4160 if (_rChild) {
4161 const char *opType = _rChild->_opType;
4162 for (int i=0; i<cnt; i++)
4163 if (strcmp(opType,vector_list[i]) == 0)
4164 return true;
4165 }
4166 return false;
4167 }
|
2241 RegClass* OperandForm::get_RegClass() const {
2242 if (_interface && !_interface->is_RegInterface()) return NULL;
2243 return globalAD->get_registers()->getRegClass(constrained_reg_class());
2244 }
2245
2246
2247 bool OperandForm::is_bound_register() const {
2248 RegClass* reg_class = get_RegClass();
2249 if (reg_class == NULL) {
2250 return false;
2251 }
2252
2253 const char* name = ideal_type(globalAD->globalNames());
2254 if (name == NULL) {
2255 return false;
2256 }
2257
2258 uint size = 0;
2259 if (strcmp(name, "RegFlags") == 0) size = 1;
2260 if (strcmp(name, "RegI") == 0) size = 1;
2261 if (strcmp(name, "RegK") == 0) size = 1;
2262 if (strcmp(name, "RegF") == 0) size = 1;
2263 if (strcmp(name, "RegD") == 0) size = 2;
2264 if (strcmp(name, "RegL") == 0) size = 2;
2265 if (strcmp(name, "RegN") == 0) size = 1;
2266 if (strcmp(name, "RegP") == 0) size = globalAD->get_preproc_def("_LP64") ? 2 : 1;
2267 if (size == 0) {
2268 return false;
2269 }
2270 return size == reg_class->size();
2271 }
2272
2273
2274 // Check if this is a valid field for this operand,
2275 // Return 'true' if valid, and set the value to the string the user provided.
2276 bool OperandForm::is_interface_field(const char *field,
2277 const char * &value) const {
2278 return false;
2279 }
2280
2281
3898 const char * &opType)const{
3899 uint position = position0;
3900
3901 return (MatchNode::base_operand( position, globals, result, name, opType));
3902 }
3903
3904
3905 bool MatchRule::is_base_register(FormDict &globals) const {
3906 uint position = 1;
3907 const char *result = NULL;
3908 const char *name = NULL;
3909 const char *opType = NULL;
3910 if (!base_operand(position, globals, result, name, opType)) {
3911 position = 0;
3912 if( base_operand(position, globals, result, name, opType) &&
3913 (strcmp(opType,"RegI")==0 ||
3914 strcmp(opType,"RegP")==0 ||
3915 strcmp(opType,"RegN")==0 ||
3916 strcmp(opType,"RegL")==0 ||
3917 strcmp(opType,"RegF")==0 ||
3918 strcmp(opType,"RegK")==0 ||
3919 strcmp(opType,"RegD")==0 ||
3920 strcmp(opType,"VecS")==0 ||
3921 strcmp(opType,"VecD")==0 ||
3922 strcmp(opType,"VecX")==0 ||
3923 strcmp(opType,"VecY")==0 ||
3924 strcmp(opType,"VecZ")==0 ||
3925 strcmp(opType,"Reg" )==0) ) {
3926 return 1;
3927 }
3928 }
3929 return 0;
3930 }
3931
3932 Form::DataType MatchRule::is_base_constant(FormDict &globals) const {
3933 uint position = 1;
3934 const char *result = NULL;
3935 const char *name = NULL;
3936 const char *opType = NULL;
3937 if (!base_operand(position, globals, result, name, opType)) {
3938 position = 0;
3939 if (base_operand(position, globals, result, name, opType)) {
3940 return ideal_to_const_type(opType);
3941 }
3942 }
3943 return Form::none;
3944 }
4125 }
4126 return false;
4127 }
4128
4129
4130 Form::DataType MatchRule::is_ideal_load() const {
4131 Form::DataType ideal_load = Form::none;
4132
4133 if ( _opType && (strcmp(_opType,"Set") == 0) && _rChild ) {
4134 const char *opType = _rChild->_opType;
4135 ideal_load = is_load_from_memory(opType);
4136 }
4137
4138 return ideal_load;
4139 }
4140
4141 bool MatchRule::is_vector() const {
4142 static const char *vector_list[] = {
4143 "AddVB","AddVS","AddVI","AddVL","AddVF","AddVD",
4144 "SubVB","SubVS","SubVI","SubVL","SubVF","SubVD",
4145 "MulVS","MulVI","MulVL","MulVF","MulVD",
4146 "DivVF","DivVD",
4147 "AndV" ,"XorV" ,"OrV",
4148 "AddReductionVI", "AddReductionVL",
4149 "AddReductionVF", "AddReductionVD",
4150 "MulReductionVI", "MulReductionVL",
4151 "MulReductionVF", "MulReductionVD",
4152 "LShiftCntV","RShiftCntV",
4153 "LShiftVB","LShiftVS","LShiftVI","LShiftVL",
4154 "RShiftVB","RShiftVS","RShiftVI","RShiftVL",
4155 "URShiftVB","URShiftVS","URShiftVI","URShiftVL",
4156 "ReplicateB","ReplicateS","ReplicateI","ReplicateL","ReplicateF","ReplicateD",
4157 "LoadVector","StoreVector",
4158 // Next are not supported currently.
4159 "PackB","PackS","PackI","PackL","PackF","PackD","Pack2L","Pack2D",
4160 "ExtractB","ExtractUB","ExtractC","ExtractS","ExtractI","ExtractL","ExtractF","ExtractD"
4161 };
4162 int cnt = sizeof(vector_list)/sizeof(char*);
4163 if (_rChild) {
4164 const char *opType = _rChild->_opType;
4165 for (int i=0; i<cnt; i++)
4166 if (strcmp(opType,vector_list[i]) == 0)
4167 return true;
4168 }
4169 return false;
4170 }
|