hotspot/src/share/vm/opto/vectornode.cpp
changeset 14128 8e2a2d167cd4
parent 13930 8df570f94294
child 14131 e376e3d428c9
equal deleted inserted replaced
14127:16ba0a8dfde2 14128:8e2a2d167cd4
    27 #include "opto/vectornode.hpp"
    27 #include "opto/vectornode.hpp"
    28 
    28 
    29 //------------------------------VectorNode--------------------------------------
    29 //------------------------------VectorNode--------------------------------------
    30 
    30 
    31 // Return the vector operator for the specified scalar operation
    31 // Return the vector operator for the specified scalar operation
    32 // and vector length.  Also used to check if the code generator
    32 // and vector length.
    33 // supports the vector operation.
       
    34 int VectorNode::opcode(int sopc, BasicType bt) {
    33 int VectorNode::opcode(int sopc, BasicType bt) {
    35   switch (sopc) {
    34   switch (sopc) {
    36   case Op_AddI:
    35   case Op_AddI:
    37     switch (bt) {
    36     switch (bt) {
    38     case T_BOOLEAN:
    37     case T_BOOLEAN:
    73     switch (bt) {
    72     switch (bt) {
    74     case T_BOOLEAN:
    73     case T_BOOLEAN:
    75     case T_BYTE:   return 0;   // Unimplemented
    74     case T_BYTE:   return 0;   // Unimplemented
    76     case T_CHAR:
    75     case T_CHAR:
    77     case T_SHORT:  return Op_MulVS;
    76     case T_SHORT:  return Op_MulVS;
    78     case T_INT:    return Matcher::match_rule_supported(Op_MulVI) ? Op_MulVI : 0; // SSE4_1
    77     case T_INT:    return Op_MulVI;
    79     }
    78     }
    80     ShouldNotReachHere();
    79     ShouldNotReachHere();
    81   case Op_MulF:
    80   case Op_MulF:
    82     assert(bt == T_FLOAT, "must be");
    81     assert(bt == T_FLOAT, "must be");
    83     return Op_MulVF;
    82     return Op_MulVF;
   155     return Op_StoreVector;
   154     return Op_StoreVector;
   156   }
   155   }
   157   return 0; // Unimplemented
   156   return 0; // Unimplemented
   158 }
   157 }
   159 
   158 
       
   159 // Also used to check if the code generator
       
   160 // supports the vector operation.
   160 bool VectorNode::implemented(int opc, uint vlen, BasicType bt) {
   161 bool VectorNode::implemented(int opc, uint vlen, BasicType bt) {
   161   if (is_java_primitive(bt) &&
   162   if (is_java_primitive(bt) &&
   162       (vlen > 1) && is_power_of_2(vlen) &&
   163       (vlen > 1) && is_power_of_2(vlen) &&
   163       Matcher::vector_size_supported(bt, vlen)) {
   164       Matcher::vector_size_supported(bt, vlen)) {
   164     int vopc = VectorNode::opcode(opc, bt);
   165     int vopc = VectorNode::opcode(opc, bt);
   165     return vopc > 0 && Matcher::has_match_rule(vopc);
   166     return vopc > 0 && Matcher::match_rule_supported(vopc);
   166   }
   167   }
   167   return false;
   168   return false;
   168 }
   169 }
   169 
   170 
   170 bool VectorNode::is_shift(Node* n) {
   171 bool VectorNode::is_shift(Node* n) {