Skip to content

Commit 9a26b4a

Browse files
committed
8379372: Enable some vector algorithms IR matching tests for RISC-V
Reviewed-by: fyang
1 parent 3e9fc5d commit 9a26b4a

1 file changed

Lines changed: 25 additions & 25 deletions

File tree

test/hotspot/jtreg/compiler/vectorization/TestVectorAlgorithms.java

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,11 @@ public void runTests(RunInfo info) {
262262
@Test
263263
@IR(counts = {IRNode.REPLICATE_I, "= 1",
264264
IRNode.STORE_VECTOR, "> 0"},
265-
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"},
265+
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"},
266266
applyIfAnd = {"UseSuperWord", "true", "OptimizeFill", "false"})
267267
@IR(counts = {".*CallLeafNoFP.*jint_fill.*", "= 1"},
268268
phase = CompilePhase.BEFORE_MATCHING,
269-
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"},
269+
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"},
270270
applyIf = {"OptimizeFill", "true"})
271271
// By default, the fill intrinsic "jint_fill" is used, but we can disable
272272
// the detection of the fill loop, and then we auto vectorize.
@@ -277,7 +277,7 @@ public Object fillI_loop(int[] r) {
277277
@Test
278278
@IR(counts = {IRNode.REPLICATE_I, "= 1",
279279
IRNode.STORE_VECTOR, "> 0"},
280-
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"})
280+
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"})
281281
public Object fillI_VectorAPI(int[] r) {
282282
return VectorAlgorithmsImpl.fillI_VectorAPI(r);
283283
}
@@ -292,7 +292,7 @@ public Object fillI_Arrays(int[] r) {
292292
@Test
293293
@IR(counts = {IRNode.POPULATE_INDEX, "> 0",
294294
IRNode.STORE_VECTOR, "> 0"},
295-
applyIfCPUFeatureOr = {"avx2", "true", "sve", "true"},
295+
applyIfCPUFeatureOr = {"avx2", "true", "sve", "true", "rvv", "true"},
296296
applyIf = {"UseSuperWord", "true"})
297297
// Note: the Vector API example below can also vectorize for AVX,
298298
// because it does not use a PopulateIndex.
@@ -303,7 +303,7 @@ public Object iotaI_loop(int[] r) {
303303
@Test
304304
@IR(counts = {IRNode.ADD_VI, "> 0",
305305
IRNode.STORE_VECTOR, "> 0"},
306-
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"},
306+
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"},
307307
applyIf = {"TieredCompilation", "true"})
308308
// IR check only works with TieredCompilation. Needs to make it
309309
// work with -XX:-TieredCompilation in future (see JDK-8378640).
@@ -314,7 +314,7 @@ public Object iotaI_VectorAPI(int[] r) {
314314
@Test
315315
@IR(counts = {IRNode.LOAD_VECTOR_I, "> 0",
316316
IRNode.STORE_VECTOR, "> 0"},
317-
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"},
317+
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"},
318318
applyIf = {"UseSuperWord", "true"})
319319
public Object copyI_loop(int[] a, int[] r) {
320320
return VectorAlgorithmsImpl.copyI_loop(a, r);
@@ -323,15 +323,15 @@ public Object copyI_loop(int[] a, int[] r) {
323323
@Test
324324
@IR(counts = {IRNode.LOAD_VECTOR_I, "> 0",
325325
IRNode.STORE_VECTOR, "> 0"},
326-
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"})
326+
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"})
327327
public Object copyI_VectorAPI(int[] a, int[] r) {
328328
return VectorAlgorithmsImpl.copyI_VectorAPI(a, r);
329329
}
330330

331331
@Test
332332
@IR(counts = {".*CallLeafNoFP.*jint_disjoint_arraycopy.*", "= 1"},
333333
phase = CompilePhase.BEFORE_MATCHING,
334-
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"})
334+
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"})
335335
public Object copyI_System_arraycopy(int[] a, int[] r) {
336336
return VectorAlgorithmsImpl.copyI_System_arraycopy(a, r);
337337
}
@@ -340,7 +340,7 @@ public Object copyI_System_arraycopy(int[] a, int[] r) {
340340
@IR(counts = {IRNode.LOAD_VECTOR_I, "> 0",
341341
IRNode.MUL_VI, "> 0",
342342
IRNode.STORE_VECTOR, "> 0"},
343-
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"},
343+
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"},
344344
applyIf = {"UseSuperWord", "true"})
345345
public Object mapI_loop(int[] a, int[] r) {
346346
return VectorAlgorithmsImpl.mapI_loop(a, r);
@@ -350,7 +350,7 @@ public Object mapI_loop(int[] a, int[] r) {
350350
@IR(counts = {IRNode.LOAD_VECTOR_I, "> 0",
351351
IRNode.MUL_VI, "> 0",
352352
IRNode.STORE_VECTOR, "> 0"},
353-
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"})
353+
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"})
354354
public Object mapI_VectorAPI(int[] a, int[] r) {
355355
return VectorAlgorithmsImpl.mapI_VectorAPI(a, r);
356356
}
@@ -359,7 +359,7 @@ public Object mapI_VectorAPI(int[] a, int[] r) {
359359
@IR(counts = {IRNode.LOAD_VECTOR_I, "> 0",
360360
IRNode.ADD_REDUCTION_VI, "> 0",
361361
IRNode.ADD_VI, "> 0"},
362-
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"},
362+
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"},
363363
applyIf = {"UseSuperWord", "true"})
364364
public int reduceAddI_loop(int[] a) {
365365
return VectorAlgorithmsImpl.reduceAddI_loop(a);
@@ -373,7 +373,7 @@ public int reduceAddI_reassociate(int[] a) {
373373
@Test
374374
@IR(counts = {IRNode.LOAD_VECTOR_I, "> 0",
375375
IRNode.ADD_REDUCTION_VI, "> 0"}, // reduceLanes inside loop
376-
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"})
376+
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"})
377377
public int reduceAddI_VectorAPI_naive(int[] a) {
378378
return VectorAlgorithmsImpl.reduceAddI_VectorAPI_naive(a);
379379
}
@@ -393,7 +393,7 @@ public float dotProductF_loop(float[] a, float[] b) {
393393
@IR(counts = {IRNode.LOAD_VECTOR_F, "> 0",
394394
IRNode.ADD_REDUCTION_V, "> 0",
395395
IRNode.MUL_VF, "> 0"},
396-
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"},
396+
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"},
397397
applyIf = {"UseSuperWord", "true"})
398398
public float dotProductF_VectorAPI_naive(float[] a, float[] b) {
399399
return VectorAlgorithmsImpl.dotProductF_VectorAPI_naive(a, b);
@@ -403,7 +403,7 @@ public float dotProductF_VectorAPI_naive(float[] a, float[] b) {
403403
@IR(counts = {IRNode.LOAD_VECTOR_F, "> 0",
404404
IRNode.ADD_REDUCTION_V, "> 0",
405405
IRNode.MUL_VF, "> 0"},
406-
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"},
406+
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"},
407407
applyIf = {"UseSuperWord", "true"})
408408
public float dotProductF_VectorAPI_reduction_after_loop(float[] a, float[] b) {
409409
return VectorAlgorithmsImpl.dotProductF_VectorAPI_reduction_after_loop(a, b);
@@ -425,7 +425,7 @@ public int hashCodeB_Arrays(byte[] a) {
425425
IRNode.MUL_VI, IRNode.VECTOR_SIZE_8, "> 0",
426426
IRNode.ADD_VI, IRNode.VECTOR_SIZE_8, "> 0",
427427
IRNode.ADD_REDUCTION_VI, "> 0"},
428-
applyIfCPUFeatureOr = {"avx2", "true", "sve", "true"},
428+
applyIfCPUFeatureOr = {"avx2", "true", "sve", "true", "rvv", "true"},
429429
applyIf = {"MaxVectorSize", ">=32"})
430430
public int hashCodeB_VectorAPI_v1(byte[] a) {
431431
return VectorAlgorithmsImpl.hashCodeB_VectorAPI_v1(a);
@@ -436,7 +436,7 @@ public int hashCodeB_VectorAPI_v1(byte[] a) {
436436
IRNode.MUL_VI, "> 0",
437437
IRNode.ADD_VI, "> 0",
438438
IRNode.ADD_REDUCTION_VI, "> 0"},
439-
applyIfCPUFeatureOr = {"avx2", "true", "asimd", "true"})
439+
applyIfCPUFeatureOr = {"avx2", "true", "asimd", "true", "rvv", "true"})
440440
public int hashCodeB_VectorAPI_v2(byte[] a) {
441441
return VectorAlgorithmsImpl.hashCodeB_VectorAPI_v2(a);
442442
}
@@ -445,7 +445,7 @@ public int hashCodeB_VectorAPI_v2(byte[] a) {
445445
@IR(counts = {IRNode.LOAD_VECTOR_I, "> 0",
446446
IRNode.ADD_REDUCTION_VI, "> 0",
447447
IRNode.ADD_VI, "> 0"},
448-
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"})
448+
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"})
449449
public int reduceAddI_VectorAPI_reduction_after_loop(int[] a) {
450450
return VectorAlgorithmsImpl.reduceAddI_VectorAPI_reduction_after_loop(a);
451451
}
@@ -469,7 +469,7 @@ public Object scanAddI_loop_reassociate(int[] a, int[] r) {
469469
IRNode.AND_VI, "> 0",
470470
IRNode.ADD_VI, "> 0",
471471
IRNode.STORE_VECTOR, "> 0"},
472-
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"},
472+
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"},
473473
applyIf = {"MaxVectorSize", ">=64"})
474474
public Object scanAddI_VectorAPI_permute_add(int[] a, int[] r) {
475475
return VectorAlgorithmsImpl.scanAddI_VectorAPI_permute_add(a, r);
@@ -488,7 +488,7 @@ public int findMinIndexI_loop(int[] a) {
488488
IRNode.VECTOR_BLEND_I, "> 0",
489489
IRNode.MIN_REDUCTION_V, "> 0",
490490
IRNode.ADD_VI, "> 0"},
491-
applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"})
491+
applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"})
492492
public int findMinIndexI_VectorAPI(int[] a) {
493493
return VectorAlgorithmsImpl.findMinIndexI_VectorAPI(a);
494494
}
@@ -504,7 +504,7 @@ public int findI_loop(int[] a, int e) {
504504
@IR(counts = {IRNode.LOAD_VECTOR_I, "> 0",
505505
IRNode.VECTOR_MASK_CMP, "> 0",
506506
IRNode.VECTOR_TEST, "> 0"},
507-
applyIfCPUFeatureOr = {"avx", "true", "asimd", "true"})
507+
applyIfCPUFeatureOr = {"avx", "true", "asimd", "true", "rvv", "true"})
508508
public int findI_VectorAPI(int[] a, int e) {
509509
return VectorAlgorithmsImpl.findI_VectorAPI(a, e);
510510
}
@@ -522,7 +522,7 @@ public Object reverseI_loop(int[] a, int[] r) {
522522
IRNode.REARRANGE_VI, "> 0",
523523
IRNode.AND_VI, "> 0",
524524
IRNode.STORE_VECTOR, "> 0"},
525-
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"})
525+
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"})
526526
public Object reverseI_VectorAPI(int[] a, int[] r) {
527527
return VectorAlgorithmsImpl.reverseI_VectorAPI(a, r);
528528
}
@@ -540,7 +540,7 @@ public Object filterI_loop(int[] a, int[] r, int threshold) {
540540
IRNode.VECTOR_TEST, "> 0",
541541
IRNode.COMPRESS_VI, "> 0",
542542
IRNode.STORE_VECTOR_MASKED, "> 0"},
543-
applyIfCPUFeatureOr = {"avx2", "true", "sve", "true"})
543+
applyIfCPUFeatureOr = {"avx2", "true", "sve", "true", "rvv", "true"})
544544
public Object filterI_VectorAPI_v1(int[] a, int[] r, int threshold) {
545545
return VectorAlgorithmsImpl.filterI_VectorAPI_v1(a, r, threshold);
546546
}
@@ -597,7 +597,7 @@ public int reduceAddIFieldsX4_loop(int[] oops, int[] mem) {
597597
IRNode.OR_V_MASK, "> 0",
598598
IRNode.ADD_VI, "> 0",
599599
IRNode.ADD_REDUCTION_VI, "> 0"},
600-
applyIfCPUFeatureOr = {"avx512", "true", "sve", "true"},
600+
applyIfCPUFeatureOr = {"avx512", "true", "sve", "true", "rvv", "true"},
601601
applyIf = {"TieredCompilation", "true"})
602602
// IR check only works with TieredCompilation. Needs to make it
603603
// work with -XX:-TieredCompilation in future (see JDK-8378640).
@@ -615,15 +615,15 @@ public Object lowerCaseB_loop(byte[] a, byte[] r) {
615615
@Test
616616
@IR(counts = {IRNode.LOAD_VECTOR_B, "> 0",
617617
IRNode.ADD_VB, "> 0"},
618-
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"})
618+
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"})
619619
public Object lowerCaseB_VectorAPI_v1(byte[] a, byte[] r) {
620620
return VectorAlgorithmsImpl.lowerCaseB_VectorAPI_v1(a, r);
621621
}
622622

623623
@Test
624624
@IR(counts = {IRNode.LOAD_VECTOR_B, "> 0",
625625
IRNode.ADD_VB, "> 0"},
626-
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true"})
626+
applyIfCPUFeatureOr = {"sse4.1", "true", "asimd", "true", "rvv", "true"})
627627
public Object lowerCaseB_VectorAPI_v2(byte[] a, byte[] r) {
628628
return VectorAlgorithmsImpl.lowerCaseB_VectorAPI_v2(a, r);
629629
}

0 commit comments

Comments
 (0)