8001101: C2: more general vector rule subsetting

Fri, 19 Oct 2012 14:21:09 -0400

author
dlong
date
Fri, 19 Oct 2012 14:21:09 -0400
changeset 4201
aaeb9add1ab3
parent 4200
e81a8af10cd9
child 4202
67f4c477c9ab

8001101: C2: more general vector rule subsetting
Summary: Allow which vector rules are supported to be decided at runtime. Also a small change to allow vector types in Type::_type_info[] to apply to more platforms.
Reviewed-by: kvn, twisti
Contributed-by: dean.long@oracle.com

src/share/vm/opto/type.cpp file | annotate | diff | comparison | revisions
src/share/vm/opto/vectornode.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/opto/type.cpp	Thu Oct 18 07:06:31 2012 -0700
     1.2 +++ b/src/share/vm/opto/type.cpp	Fri Oct 19 14:21:09 2012 -0400
     1.3 @@ -61,7 +61,7 @@
     1.4    { Bad,             T_ILLEGAL,    "tuple:",        false, Node::NotAMachineReg, relocInfo::none          },  // Tuple
     1.5    { Bad,             T_ARRAY,      "array:",        false, Node::NotAMachineReg, relocInfo::none          },  // Array
     1.6  
     1.7 -#if defined(IA32) || defined(AMD64)
     1.8 +#ifndef SPARC
     1.9    { Bad,             T_ILLEGAL,    "vectors:",      false, Op_VecS,              relocInfo::none          },  // VectorS
    1.10    { Bad,             T_ILLEGAL,    "vectord:",      false, Op_VecD,              relocInfo::none          },  // VectorD
    1.11    { Bad,             T_ILLEGAL,    "vectorx:",      false, Op_VecX,              relocInfo::none          },  // VectorX
     2.1 --- a/src/share/vm/opto/vectornode.cpp	Thu Oct 18 07:06:31 2012 -0700
     2.2 +++ b/src/share/vm/opto/vectornode.cpp	Fri Oct 19 14:21:09 2012 -0400
     2.3 @@ -29,8 +29,7 @@
     2.4  //------------------------------VectorNode--------------------------------------
     2.5  
     2.6  // Return the vector operator for the specified scalar operation
     2.7 -// and vector length.  Also used to check if the code generator
     2.8 -// supports the vector operation.
     2.9 +// and vector length.
    2.10  int VectorNode::opcode(int sopc, BasicType bt) {
    2.11    switch (sopc) {
    2.12    case Op_AddI:
    2.13 @@ -75,7 +74,7 @@
    2.14      case T_BYTE:   return 0;   // Unimplemented
    2.15      case T_CHAR:
    2.16      case T_SHORT:  return Op_MulVS;
    2.17 -    case T_INT:    return Matcher::match_rule_supported(Op_MulVI) ? Op_MulVI : 0; // SSE4_1
    2.18 +    case T_INT:    return Op_MulVI;
    2.19      }
    2.20      ShouldNotReachHere();
    2.21    case Op_MulF:
    2.22 @@ -157,12 +156,14 @@
    2.23    return 0; // Unimplemented
    2.24  }
    2.25  
    2.26 +// Also used to check if the code generator
    2.27 +// supports the vector operation.
    2.28  bool VectorNode::implemented(int opc, uint vlen, BasicType bt) {
    2.29    if (is_java_primitive(bt) &&
    2.30        (vlen > 1) && is_power_of_2(vlen) &&
    2.31        Matcher::vector_size_supported(bt, vlen)) {
    2.32      int vopc = VectorNode::opcode(opc, bt);
    2.33 -    return vopc > 0 && Matcher::has_match_rule(vopc);
    2.34 +    return vopc > 0 && Matcher::match_rule_supported(vopc);
    2.35    }
    2.36    return false;
    2.37  }

mercurial