< prev index next >

src/hotspot/share/adlc/formssel.cpp

Print this page
rev 53043 : 8214922: Add vectorization support for fmin/fmax
Reviewed-by: duke


3785     if( !_rChild->equivalent(globals, mNode2->_rChild) )
3786       return false;
3787   } else if (mNode2->_rChild) {
3788     return false; // I have NULL right child, mNode2 has non-NULL right child.
3789   }
3790 
3791   // We've made it through the gauntlet.
3792   return true;
3793 }
3794 
3795 //-------------------------- has_commutative_op -------------------------------
3796 // Recursively check for commutative operations with subtree operands
3797 // which could be swapped.
3798 void MatchNode::count_commutative_op(int& count) {
3799   static const char *commut_op_list[] = {
3800     "AddI","AddL","AddF","AddD",
3801     "AddVB","AddVS","AddVI","AddVL","AddVF","AddVD",
3802     "AndI","AndL",
3803     "AndV",
3804     "MaxI","MinI","MaxF","MinF","MaxD","MinD",

3805     "MulI","MulL","MulF","MulD",
3806     "MulVS","MulVI","MulVL","MulVF","MulVD",
3807     "OrI","OrL",
3808     "OrV",
3809     "XorI","XorL",
3810     "XorV"
3811   };
3812   int cnt = sizeof(commut_op_list)/sizeof(char*);
3813 
3814   if( _lChild && _rChild && (_lChild->_lChild || _rChild->_lChild) ) {
3815     // Don't swap if right operand is an immediate constant.
3816     bool is_const = false;
3817     if( _rChild->_lChild == NULL && _rChild->_rChild == NULL ) {
3818       FormDict &globals = _AD.globalNames();
3819       const Form *form = globals[_rChild->_opType];
3820       if ( form ) {
3821         OperandForm  *oper = form->is_operand();
3822         if( oper && oper->interface_type(globals) == Form::constant_interface )
3823           is_const = true;
3824       }


4160 
4161   if ( _opType && (strcmp(_opType,"Set") == 0) && _rChild ) {
4162     const char *opType = _rChild->_opType;
4163     ideal_load = is_load_from_memory(opType);
4164   }
4165 
4166   return ideal_load;
4167 }
4168 
4169 bool MatchRule::is_vector() const {
4170   static const char *vector_list[] = {
4171     "AddVB","AddVS","AddVI","AddVL","AddVF","AddVD",
4172     "SubVB","SubVS","SubVI","SubVL","SubVF","SubVD",
4173     "MulVS","MulVI","MulVL","MulVF","MulVD",
4174     "CMoveVD", "CMoveVF",
4175     "DivVF","DivVD",
4176     "AbsVF","AbsVD",
4177     "NegVF","NegVD",
4178     "SqrtVD","SqrtVF",
4179     "AndV" ,"XorV" ,"OrV",

4180     "AddReductionVI", "AddReductionVL",
4181     "AddReductionVF", "AddReductionVD",
4182     "MulReductionVI", "MulReductionVL",
4183     "MulReductionVF", "MulReductionVD",
4184     "MulAddVS2VI",
4185     "LShiftCntV","RShiftCntV",
4186     "LShiftVB","LShiftVS","LShiftVI","LShiftVL",
4187     "RShiftVB","RShiftVS","RShiftVI","RShiftVL",
4188     "URShiftVB","URShiftVS","URShiftVI","URShiftVL",

4189     "ReplicateB","ReplicateS","ReplicateI","ReplicateL","ReplicateF","ReplicateD",
4190     "LoadVector","StoreVector",
4191     "FmaVD", "FmaVF","PopCountVI",
4192     // Next are not supported currently.
4193     "PackB","PackS","PackI","PackL","PackF","PackD","Pack2L","Pack2D",
4194     "ExtractB","ExtractUB","ExtractC","ExtractS","ExtractI","ExtractL","ExtractF","ExtractD"
4195   };
4196   int cnt = sizeof(vector_list)/sizeof(char*);
4197   if (_rChild) {
4198     const char  *opType = _rChild->_opType;
4199     for (int i=0; i<cnt; i++)
4200       if (strcmp(opType,vector_list[i]) == 0)
4201         return true;
4202   }
4203   return false;
4204 }
4205 
4206 
4207 bool MatchRule::skip_antidep_check() const {
4208   // Some loads operate on what is effectively immutable memory so we




3785     if( !_rChild->equivalent(globals, mNode2->_rChild) )
3786       return false;
3787   } else if (mNode2->_rChild) {
3788     return false; // I have NULL right child, mNode2 has non-NULL right child.
3789   }
3790 
3791   // We've made it through the gauntlet.
3792   return true;
3793 }
3794 
3795 //-------------------------- has_commutative_op -------------------------------
3796 // Recursively check for commutative operations with subtree operands
3797 // which could be swapped.
3798 void MatchNode::count_commutative_op(int& count) {
3799   static const char *commut_op_list[] = {
3800     "AddI","AddL","AddF","AddD",
3801     "AddVB","AddVS","AddVI","AddVL","AddVF","AddVD",
3802     "AndI","AndL",
3803     "AndV",
3804     "MaxI","MinI","MaxF","MinF","MaxD","MinD",
3805     "MaxV", "MinV",
3806     "MulI","MulL","MulF","MulD",
3807     "MulVS","MulVI","MulVL","MulVF","MulVD",
3808     "OrI","OrL",
3809     "OrV",
3810     "XorI","XorL",
3811     "XorV"
3812   };
3813   int cnt = sizeof(commut_op_list)/sizeof(char*);
3814 
3815   if( _lChild && _rChild && (_lChild->_lChild || _rChild->_lChild) ) {
3816     // Don't swap if right operand is an immediate constant.
3817     bool is_const = false;
3818     if( _rChild->_lChild == NULL && _rChild->_rChild == NULL ) {
3819       FormDict &globals = _AD.globalNames();
3820       const Form *form = globals[_rChild->_opType];
3821       if ( form ) {
3822         OperandForm  *oper = form->is_operand();
3823         if( oper && oper->interface_type(globals) == Form::constant_interface )
3824           is_const = true;
3825       }


4161 
4162   if ( _opType && (strcmp(_opType,"Set") == 0) && _rChild ) {
4163     const char *opType = _rChild->_opType;
4164     ideal_load = is_load_from_memory(opType);
4165   }
4166 
4167   return ideal_load;
4168 }
4169 
4170 bool MatchRule::is_vector() const {
4171   static const char *vector_list[] = {
4172     "AddVB","AddVS","AddVI","AddVL","AddVF","AddVD",
4173     "SubVB","SubVS","SubVI","SubVL","SubVF","SubVD",
4174     "MulVS","MulVI","MulVL","MulVF","MulVD",
4175     "CMoveVD", "CMoveVF",
4176     "DivVF","DivVD",
4177     "AbsVF","AbsVD",
4178     "NegVF","NegVD",
4179     "SqrtVD","SqrtVF",
4180     "AndV" ,"XorV" ,"OrV",
4181     "MaxV", "MinV",
4182     "AddReductionVI", "AddReductionVL",
4183     "AddReductionVF", "AddReductionVD",
4184     "MulReductionVI", "MulReductionVL",
4185     "MulReductionVF", "MulReductionVD",
4186     "MulAddVS2VI",
4187     "LShiftCntV","RShiftCntV",
4188     "LShiftVB","LShiftVS","LShiftVI","LShiftVL",
4189     "RShiftVB","RShiftVS","RShiftVI","RShiftVL",
4190     "URShiftVB","URShiftVS","URShiftVI","URShiftVL",
4191     "MaxReductionV", "MinReductionV",
4192     "ReplicateB","ReplicateS","ReplicateI","ReplicateL","ReplicateF","ReplicateD",
4193     "LoadVector","StoreVector",
4194     "FmaVD", "FmaVF","PopCountVI",
4195     // Next are not supported currently.
4196     "PackB","PackS","PackI","PackL","PackF","PackD","Pack2L","Pack2D",
4197     "ExtractB","ExtractUB","ExtractC","ExtractS","ExtractI","ExtractL","ExtractF","ExtractD"
4198   };
4199   int cnt = sizeof(vector_list)/sizeof(char*);
4200   if (_rChild) {
4201     const char  *opType = _rChild->_opType;
4202     for (int i=0; i<cnt; i++)
4203       if (strcmp(opType,vector_list[i]) == 0)
4204         return true;
4205   }
4206   return false;
4207 }
4208 
4209 
4210 bool MatchRule::skip_antidep_check() const {
4211   // Some loads operate on what is effectively immutable memory so we


< prev index next >