@@ -2062,97 +2062,78 @@ static int frame_slots_bias(int reg_enc, PhaseRegAlloc* ra_) {
2062
2062
}
2063
2063
2064
2064
const bool Matcher::match_rule_supported(int opcode) {
2065
- if (!has_match_rule(opcode))
2066
- return false;
2065
+ if (!has_match_rule(opcode)) {
2066
+ return false; // no match rule present
2067
+ }
2067
2068
2068
- bool ret_value = true;
2069
2069
switch (opcode) {
2070
- case Op_SqrtD:
2071
- return VM_Version::has_fsqrt();
2072
- case Op_CountLeadingZerosI:
2073
- case Op_CountLeadingZerosL:
2074
- if (!UseCountLeadingZerosInstructionsPPC64)
2075
- return false;
2076
- break;
2077
- case Op_CountTrailingZerosI:
2078
- case Op_CountTrailingZerosL:
2079
- if (!UseCountLeadingZerosInstructionsPPC64 &&
2080
- !UseCountTrailingZerosInstructionsPPC64)
2081
- return false;
2082
- break;
2083
-
2084
- case Op_PopCountI:
2085
- case Op_PopCountL:
2086
- return (UsePopCountInstruction && VM_Version::has_popcntw());
2087
-
2088
- case Op_StrComp:
2089
- return SpecialStringCompareTo;
2090
- case Op_StrEquals:
2091
- return SpecialStringEquals;
2092
- case Op_StrIndexOf:
2093
- case Op_StrIndexOfChar:
2094
- return SpecialStringIndexOf;
2095
- case Op_AddVB:
2096
- case Op_AddVS:
2097
- case Op_AddVI:
2098
- case Op_AddVF:
2099
- case Op_AddVD:
2100
- case Op_SubVB:
2101
- case Op_SubVS:
2102
- case Op_SubVI:
2103
- case Op_SubVF:
2104
- case Op_SubVD:
2105
- case Op_MulVS:
2106
- case Op_MulVF:
2107
- case Op_MulVD:
2108
- case Op_DivVF:
2109
- case Op_DivVD:
2110
- case Op_AbsVF:
2111
- case Op_AbsVD:
2112
- case Op_NegVF:
2113
- case Op_NegVD:
2114
- case Op_SqrtVF:
2115
- case Op_SqrtVD:
2116
- case Op_AddVL:
2117
- case Op_SubVL:
2118
- case Op_MulVI:
2119
- case Op_RoundDoubleModeV:
2120
- return SuperwordUseVSX;
2121
- case Op_PopCountVI:
2122
- return (SuperwordUseVSX && UsePopCountInstruction);
2123
- case Op_FmaVF:
2124
- case Op_FmaVD:
2125
- return (SuperwordUseVSX && UseFMA);
2126
- case Op_Digit:
2127
- return vmIntrinsics::is_intrinsic_available(vmIntrinsics::_isDigit);
2128
- case Op_LowerCase:
2129
- return vmIntrinsics::is_intrinsic_available(vmIntrinsics::_isLowerCase);
2130
- case Op_UpperCase:
2131
- return vmIntrinsics::is_intrinsic_available(vmIntrinsics::_isUpperCase);
2132
- case Op_Whitespace:
2133
- return vmIntrinsics::is_intrinsic_available(vmIntrinsics::_isWhitespace);
2134
-
2135
- case Op_CacheWB:
2136
- case Op_CacheWBPreSync:
2137
- case Op_CacheWBPostSync:
2138
- if (!VM_Version::supports_data_cache_line_flush()) {
2139
- ret_value = false;
2140
- }
2141
- break;
2070
+ case Op_SqrtD:
2071
+ return VM_Version::has_fsqrt();
2072
+ case Op_CountLeadingZerosI:
2073
+ case Op_CountLeadingZerosL:
2074
+ return UseCountLeadingZerosInstructionsPPC64;
2075
+ case Op_CountTrailingZerosI:
2076
+ case Op_CountTrailingZerosL:
2077
+ return (UseCountLeadingZerosInstructionsPPC64 || UseCountTrailingZerosInstructionsPPC64);
2078
+ case Op_PopCountI:
2079
+ case Op_PopCountL:
2080
+ return (UsePopCountInstruction && VM_Version::has_popcntw());
2081
+
2082
+ case Op_AddVB:
2083
+ case Op_AddVS:
2084
+ case Op_AddVI:
2085
+ case Op_AddVF:
2086
+ case Op_AddVD:
2087
+ case Op_SubVB:
2088
+ case Op_SubVS:
2089
+ case Op_SubVI:
2090
+ case Op_SubVF:
2091
+ case Op_SubVD:
2092
+ case Op_MulVS:
2093
+ case Op_MulVF:
2094
+ case Op_MulVD:
2095
+ case Op_DivVF:
2096
+ case Op_DivVD:
2097
+ case Op_AbsVF:
2098
+ case Op_AbsVD:
2099
+ case Op_NegVF:
2100
+ case Op_NegVD:
2101
+ case Op_SqrtVF:
2102
+ case Op_SqrtVD:
2103
+ case Op_AddVL:
2104
+ case Op_SubVL:
2105
+ case Op_MulVI:
2106
+ case Op_RoundDoubleModeV:
2107
+ return SuperwordUseVSX;
2108
+ case Op_PopCountVI:
2109
+ return (SuperwordUseVSX && UsePopCountInstruction);
2110
+ case Op_FmaVF:
2111
+ case Op_FmaVD:
2112
+ return (SuperwordUseVSX && UseFMA);
2113
+
2114
+ case Op_Digit:
2115
+ return vmIntrinsics::is_intrinsic_available(vmIntrinsics::_isDigit);
2116
+ case Op_LowerCase:
2117
+ return vmIntrinsics::is_intrinsic_available(vmIntrinsics::_isLowerCase);
2118
+ case Op_UpperCase:
2119
+ return vmIntrinsics::is_intrinsic_available(vmIntrinsics::_isUpperCase);
2120
+ case Op_Whitespace:
2121
+ return vmIntrinsics::is_intrinsic_available(vmIntrinsics::_isWhitespace);
2122
+
2123
+ case Op_CacheWB:
2124
+ case Op_CacheWBPreSync:
2125
+ case Op_CacheWBPostSync:
2126
+ return VM_Version::supports_data_cache_line_flush();
2142
2127
}
2143
2128
2144
- return ret_value; // Per default match rules are supported.
2129
+ return true; // Per default match rules are supported.
2145
2130
}
2146
2131
2147
2132
const bool Matcher::match_rule_supported_vector(int opcode, int vlen, BasicType bt) {
2148
-
2149
- // TODO
2150
- // identify extra cases that we might want to provide match rules for
2151
- // e.g. Op_ vector nodes and other intrinsics while guarding with vlen
2152
- bool ret_value = match_rule_supported(opcode);
2153
- // Add rules here.
2154
-
2155
- return ret_value; // Per default match rules are supported.
2133
+ if (!match_rule_supported(opcode) || !vector_size_supported(bt, vlen)) {
2134
+ return false;
2135
+ }
2136
+ return true; // Per default match rules are supported.
2156
2137
}
2157
2138
2158
2139
const bool Matcher::has_predicated_vectors(void) {
@@ -6569,6 +6550,23 @@ instruct storeV16(indirect mem, vecX src) %{
6569
6550
ins_pipe(pipe_class_default);
6570
6551
%}
6571
6552
6553
+ // Reinterpret: only one vector size used: either L or X
6554
+ instruct reinterpretL(iRegLdst dst) %{
6555
+ match(Set dst (VectorReinterpret dst));
6556
+ ins_cost(0);
6557
+ format %{ "reinterpret $dst" %}
6558
+ ins_encode( /*empty*/ );
6559
+ ins_pipe(pipe_class_empty);
6560
+ %}
6561
+
6562
+ instruct reinterpretX(vecX dst) %{
6563
+ match(Set dst (VectorReinterpret dst));
6564
+ ins_cost(0);
6565
+ format %{ "reinterpret $dst" %}
6566
+ ins_encode( /*empty*/ );
6567
+ ins_pipe(pipe_class_empty);
6568
+ %}
6569
+
6572
6570
// Store Compressed Oop
6573
6571
instruct storeN(memory dst, iRegN_P2N src) %{
6574
6572
match(Set dst (StoreN dst src));
0 commit comments