8257483: C2: Split immediate vector rotate from RotateLeftV and RotateRightV nodes

Reviewed-by: vlivanov
This commit is contained in:
Dong Bo 2020-12-10 12:26:04 +00:00 committed by Fei Yang
parent 0a0691ebcf
commit 026b09cf64
7 changed files with 27 additions and 2 deletions

View file

@ -2437,6 +2437,10 @@ bool Matcher::supports_vector_variable_shifts(void) {
return true;
}
bool Matcher::supports_vector_variable_rotates(void) {
return false; // not supported
}
const int Matcher::float_pressure(int default_pressure_threshold) {
return default_pressure_threshold;
}

View file

@ -997,6 +997,10 @@ bool Matcher::supports_vector_variable_shifts(void) {
return VM_Version::has_simd();
}
bool Matcher::supports_vector_variable_rotates(void) {
return false; // not supported
}
const int Matcher::float_pressure(int default_pressure_threshold) {
return default_pressure_threshold;
}

View file

@ -2155,6 +2155,10 @@ bool Matcher::supports_vector_variable_shifts(void) {
return false; // not supported
}
bool Matcher::supports_vector_variable_rotates(void) {
return false; // not supported
}
const int Matcher::float_pressure(int default_pressure_threshold) {
return default_pressure_threshold;
}

View file

@ -1550,6 +1550,10 @@ bool Matcher::supports_vector_variable_shifts(void) {
return false; // not supported
}
bool Matcher::supports_vector_variable_rotates(void) {
return false; // not supported
}
const int Matcher::float_pressure(int default_pressure_threshold) {
return default_pressure_threshold;
}

View file

@ -1814,6 +1814,10 @@ bool Matcher::supports_vector_variable_shifts(void) {
return (UseAVX >= 2);
}
bool Matcher::supports_vector_variable_rotates(void) {
return true;
}
const bool Matcher::has_predicated_vectors(void) {
bool ret_value = false;
if (UseAVX > 2) {

View file

@ -348,6 +348,9 @@ public:
// Does the CPU supports vector variable shift instructions?
static bool supports_vector_variable_shifts(void);
// Does the CPU supports vector vairable rotate instructions?
static bool supports_vector_variable_rotates(void);
// CPU supports misaligned vectors store/load.
static const bool misaligned_vectors_ok();

View file

@ -1172,7 +1172,8 @@ Node* VectorNode::degenerate_vector_rotate(Node* src, Node* cnt, bool is_rotate_
Node* RotateLeftVNode::Ideal(PhaseGVN* phase, bool can_reshape) {
int vlen = length();
BasicType bt = vect_type()->element_basic_type();
if (!Matcher::match_rule_supported_vector(Op_RotateLeftV, vlen, bt)) {
if ((!in(2)->is_Con() && !Matcher::supports_vector_variable_rotates()) ||
!Matcher::match_rule_supported_vector(Op_RotateLeftV, vlen, bt)) {
return VectorNode::degenerate_vector_rotate(in(1), in(2), true, vlen, bt, phase);
}
return NULL;
@ -1181,7 +1182,8 @@ Node* RotateLeftVNode::Ideal(PhaseGVN* phase, bool can_reshape) {
Node* RotateRightVNode::Ideal(PhaseGVN* phase, bool can_reshape) {
int vlen = length();
BasicType bt = vect_type()->element_basic_type();
if (!Matcher::match_rule_supported_vector(Op_RotateRightV, vlen, bt)) {
if ((!in(2)->is_Con() && !Matcher::supports_vector_variable_rotates()) ||
!Matcher::match_rule_supported_vector(Op_RotateRightV, vlen, bt)) {
return VectorNode::degenerate_vector_rotate(in(1), in(2), false, vlen, bt, phase);
}
return NULL;