|
23 | 23 |
|
24 | 24 | /*
|
25 | 25 | * @test
|
26 |
| -* @bug 8356760 |
| 26 | +* @bug 8356760 8367391 |
27 | 27 | * @library /test/lib /
|
28 | 28 | * @summary Optimize VectorMask.fromLong for all-true/all-false cases
|
29 | 29 | * @modules jdk.incubator.vector
|
@@ -173,92 +173,98 @@ public static void testMaskFromLongMaskAllDouble() {
|
173 | 173 |
|
174 | 174 | @Test
|
175 | 175 | @IR(counts = { IRNode.MASK_ALL, "= 0",
|
176 |
| - IRNode.VECTOR_LONG_TO_MASK, "> 0" }, |
| 176 | + IRNode.VECTOR_LONG_TO_MASK, "= 2" }, |
177 | 177 | applyIfCPUFeatureOr = { "sve2", "true", "avx512", "true", "rvv", "true" })
|
178 | 178 | @IR(counts = { IRNode.REPLICATE_B, "= 0",
|
179 | 179 | IRNode.VECTOR_LONG_TO_MASK, "= 0" },
|
180 | 180 | applyIfCPUFeatureAnd = { "asimd", "true", "sve", "false" })
|
181 | 181 | @IR(counts = { IRNode.REPLICATE_B, "= 0",
|
182 |
| - IRNode.VECTOR_LONG_TO_MASK, "> 0" }, |
| 182 | + IRNode.VECTOR_LONG_TO_MASK, "= 2" }, |
183 | 183 | applyIfCPUFeatureAnd = { "avx2", "true", "avx512", "false" })
|
184 | 184 | public static void testMaskFromLongByte() {
|
185 |
| - // Test the case where some but not all bits are set. |
186 |
| - testMaskFromLong(B_SPECIES, (-1L >>> (64 - B_SPECIES.length()))-1); |
| 185 | + // Test cases where some but not all bits are set. |
| 186 | + testMaskFromLong(B_SPECIES, (-1L >>> (64 - B_SPECIES.length())) - 1); |
| 187 | + testMaskFromLong(B_SPECIES, (-1L >>> (64 - B_SPECIES.length())) >>> 1); |
187 | 188 | }
|
188 | 189 |
|
189 | 190 | @Test
|
190 | 191 | @IR(counts = { IRNode.MASK_ALL, "= 0",
|
191 |
| - IRNode.VECTOR_LONG_TO_MASK, "> 0" }, |
| 192 | + IRNode.VECTOR_LONG_TO_MASK, "= 2" }, |
192 | 193 | applyIfCPUFeatureOr = { "sve2", "true", "avx512", "true", "rvv", "true" })
|
193 | 194 | @IR(counts = { IRNode.REPLICATE_S, "= 0",
|
194 | 195 | IRNode.VECTOR_LONG_TO_MASK, "= 0" },
|
195 | 196 | applyIfCPUFeatureAnd = { "asimd", "true", "sve", "false" })
|
196 | 197 | @IR(counts = { IRNode.REPLICATE_S, "= 0",
|
197 |
| - IRNode.VECTOR_LONG_TO_MASK, "> 0" }, |
| 198 | + IRNode.VECTOR_LONG_TO_MASK, "= 2" }, |
198 | 199 | applyIfCPUFeatureAnd = { "avx2", "true", "avx512", "false" })
|
199 | 200 | public static void testMaskFromLongShort() {
|
200 |
| - // Test the case where some but not all bits are set. |
201 |
| - testMaskFromLong(S_SPECIES, (-1L >>> (64 - S_SPECIES.length()))-1); |
| 201 | + // Test cases where some but not all bits are set. |
| 202 | + testMaskFromLong(S_SPECIES, (-1L >>> (64 - S_SPECIES.length())) - 1); |
| 203 | + testMaskFromLong(S_SPECIES, (-1L >>> (64 - S_SPECIES.length())) >>> 1); |
202 | 204 | }
|
203 | 205 |
|
204 | 206 | @Test
|
205 | 207 | @IR(counts = { IRNode.MASK_ALL, "= 0",
|
206 |
| - IRNode.VECTOR_LONG_TO_MASK, "> 0" }, |
| 208 | + IRNode.VECTOR_LONG_TO_MASK, "= 2" }, |
207 | 209 | applyIfCPUFeatureOr = { "sve2", "true", "avx512", "true", "rvv", "true" })
|
208 | 210 | @IR(counts = { IRNode.REPLICATE_I, "= 0",
|
209 | 211 | IRNode.VECTOR_LONG_TO_MASK, "= 0" },
|
210 | 212 | applyIfCPUFeatureAnd = { "asimd", "true", "sve", "false" })
|
211 | 213 | @IR(counts = { IRNode.REPLICATE_I, "= 0",
|
212 |
| - IRNode.VECTOR_LONG_TO_MASK, "> 0" }, |
| 214 | + IRNode.VECTOR_LONG_TO_MASK, "= 2" }, |
213 | 215 | applyIfCPUFeatureAnd = { "avx2", "true", "avx512", "false" })
|
214 | 216 | public static void testMaskFromLongInt() {
|
215 |
| - // Test the case where some but not all bits are set. |
216 |
| - testMaskFromLong(I_SPECIES, (-1L >>> (64 - I_SPECIES.length()))-1); |
| 217 | + // Test cases where some but not all bits are set. |
| 218 | + testMaskFromLong(I_SPECIES, (-1L >>> (64 - I_SPECIES.length())) - 1); |
| 219 | + testMaskFromLong(I_SPECIES, (-1L >>> (64 - I_SPECIES.length())) >>> 1); |
217 | 220 | }
|
218 | 221 |
|
219 | 222 | @Test
|
220 | 223 | @IR(counts = { IRNode.MASK_ALL, "= 0",
|
221 |
| - IRNode.VECTOR_LONG_TO_MASK, "> 0" }, |
| 224 | + IRNode.VECTOR_LONG_TO_MASK, "= 2" }, |
222 | 225 | applyIfCPUFeatureOr = { "sve2", "true", "avx512", "true", "rvv", "true" })
|
223 | 226 | @IR(counts = { IRNode.REPLICATE_L, "= 0",
|
224 | 227 | IRNode.VECTOR_LONG_TO_MASK, "= 0" },
|
225 | 228 | applyIfCPUFeatureAnd = { "asimd", "true", "sve", "false" })
|
226 | 229 | @IR(counts = { IRNode.REPLICATE_L, "= 0",
|
227 |
| - IRNode.VECTOR_LONG_TO_MASK, "> 0" }, |
| 230 | + IRNode.VECTOR_LONG_TO_MASK, "= 2" }, |
228 | 231 | applyIfCPUFeatureAnd = { "avx2", "true", "avx512", "false" })
|
229 | 232 | public static void testMaskFromLongLong() {
|
230 |
| - // Test the case where some but not all bits are set. |
231 |
| - testMaskFromLong(L_SPECIES, (-1L >>> (64 - L_SPECIES.length()))-1); |
| 233 | + // Test cases where some but not all bits are set. |
| 234 | + testMaskFromLong(L_SPECIES, (-1L >>> (64 - L_SPECIES.length())) - 1); |
| 235 | + testMaskFromLong(L_SPECIES, (-1L >>> (64 - L_SPECIES.length())) >>> 1); |
232 | 236 | }
|
233 | 237 |
|
234 | 238 | @Test
|
235 | 239 | @IR(counts = { IRNode.MASK_ALL, "= 0",
|
236 |
| - IRNode.VECTOR_LONG_TO_MASK, "> 0" }, |
| 240 | + IRNode.VECTOR_LONG_TO_MASK, "= 2" }, |
237 | 241 | applyIfCPUFeatureOr = { "sve2", "true", "avx512", "true", "rvv", "true" })
|
238 | 242 | @IR(counts = { IRNode.REPLICATE_I, "= 0",
|
239 | 243 | IRNode.VECTOR_LONG_TO_MASK, "= 0" },
|
240 | 244 | applyIfCPUFeatureAnd = { "asimd", "true", "sve", "false" })
|
241 | 245 | @IR(counts = { IRNode.REPLICATE_I, "= 0",
|
242 |
| - IRNode.VECTOR_LONG_TO_MASK, "> 0" }, |
| 246 | + IRNode.VECTOR_LONG_TO_MASK, "= 2" }, |
243 | 247 | applyIfCPUFeatureAnd = { "avx2", "true", "avx512", "false" })
|
244 | 248 | public static void testMaskFromLongFloat() {
|
245 |
| - // Test the case where some but not all bits are set. |
246 |
| - testMaskFromLong(F_SPECIES, (-1L >>> (64 - F_SPECIES.length()))-1); |
| 249 | + // Test cases where some but not all bits are set. |
| 250 | + testMaskFromLong(F_SPECIES, (-1L >>> (64 - F_SPECIES.length())) - 1); |
| 251 | + testMaskFromLong(F_SPECIES, (-1L >>> (64 - F_SPECIES.length())) >>> 1); |
247 | 252 | }
|
248 | 253 |
|
249 | 254 | @Test
|
250 | 255 | @IR(counts = { IRNode.MASK_ALL, "= 0",
|
251 |
| - IRNode.VECTOR_LONG_TO_MASK, "> 0" }, |
| 256 | + IRNode.VECTOR_LONG_TO_MASK, "= 2" }, |
252 | 257 | applyIfCPUFeatureOr = { "sve2", "true", "avx512", "true", "rvv", "true" })
|
253 | 258 | @IR(counts = { IRNode.REPLICATE_L, "= 0",
|
254 | 259 | IRNode.VECTOR_LONG_TO_MASK, "= 0" },
|
255 | 260 | applyIfCPUFeatureAnd = { "asimd", "true", "sve", "false" })
|
256 | 261 | @IR(counts = { IRNode.REPLICATE_L, "= 0",
|
257 |
| - IRNode.VECTOR_LONG_TO_MASK, "> 0" }, |
| 262 | + IRNode.VECTOR_LONG_TO_MASK, "= 2" }, |
258 | 263 | applyIfCPUFeatureAnd = { "avx2", "true", "avx512", "false" })
|
259 | 264 | public static void testMaskFromLongDouble() {
|
260 |
| - // Test the case where some but not all bits are set. |
261 |
| - testMaskFromLong(D_SPECIES, (-1L >>> (64 - D_SPECIES.length()))-1); |
| 265 | + // Test cases where some but not all bits are set. |
| 266 | + testMaskFromLong(D_SPECIES, (-1L >>> (64 - D_SPECIES.length())) - 1); |
| 267 | + testMaskFromLong(D_SPECIES, (-1L >>> (64 - D_SPECIES.length())) >>> 1); |
262 | 268 | }
|
263 | 269 |
|
264 | 270 | public static void main(String[] args) {
|
|
0 commit comments