Mercurial > hg > graal-compiler
comparison src/share/vm/opto/vectornode.cpp @ 6890:aaeb9add1ab3
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
author | dlong |
---|---|
date | Fri, 19 Oct 2012 14:21:09 -0400 |
parents | 859c45fb8cea |
children | b2c669fd8114 |
comparison
equal
deleted
inserted
replaced
6889:e81a8af10cd9 | 6890:aaeb9add1ab3 |
---|---|
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) { |