Skip to content

Commit 56bb34f

Browse files
committed
Add an IR rule for vector mask cast operation
1 parent 52bbd3c commit 56bb34f

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

test/hotspot/jtreg/compiler/vectorapi/VectorMaskCompareNotTest.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ public static void testCompareMaskNotDouble(VectorSpecies<Double> vs, VectorOper
270270
@Test
271271
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
272272
IRNode.XOR_V, "= 0",
273+
IRNode.VECTOR_MASK_CAST, "= 1",
273274
IRNode.VECTOR_MASK_CMP, "= 3" },
274275
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
275276
public static void testCompareEQMaskNotByte() {
@@ -285,6 +286,7 @@ public static void testCompareEQMaskNotByte() {
285286
@Test
286287
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
287288
IRNode.XOR_V, "= 0",
289+
IRNode.VECTOR_MASK_CAST, "= 1",
288290
IRNode.VECTOR_MASK_CMP, "= 3" },
289291
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
290292
public static void testCompareNEMaskNotByte() {
@@ -300,6 +302,7 @@ public static void testCompareNEMaskNotByte() {
300302
@Test
301303
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
302304
IRNode.XOR_V, "= 0",
305+
IRNode.VECTOR_MASK_CAST, "= 1",
303306
IRNode.VECTOR_MASK_CMP, "= 3" },
304307
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
305308
public static void testCompareLTMaskNotByte() {
@@ -315,6 +318,7 @@ public static void testCompareLTMaskNotByte() {
315318
@Test
316319
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
317320
IRNode.XOR_V, "= 0",
321+
IRNode.VECTOR_MASK_CAST, "= 1",
318322
IRNode.VECTOR_MASK_CMP, "= 3" },
319323
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
320324
public static void testCompareGTMaskNotByte() {
@@ -330,6 +334,7 @@ public static void testCompareGTMaskNotByte() {
330334
@Test
331335
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
332336
IRNode.XOR_V, "= 0",
337+
IRNode.VECTOR_MASK_CAST, "= 1",
333338
IRNode.VECTOR_MASK_CMP, "= 3" },
334339
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
335340
public static void testCompareLEMaskNotByte() {
@@ -345,6 +350,7 @@ public static void testCompareLEMaskNotByte() {
345350
@Test
346351
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
347352
IRNode.XOR_V, "= 0",
353+
IRNode.VECTOR_MASK_CAST, "= 1",
348354
IRNode.VECTOR_MASK_CMP, "= 3" },
349355
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
350356
public static void testCompareGEMaskNotByte() {
@@ -360,6 +366,7 @@ public static void testCompareGEMaskNotByte() {
360366
@Test
361367
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
362368
IRNode.XOR_V, "= 0",
369+
IRNode.VECTOR_MASK_CAST, "= 1",
363370
IRNode.VECTOR_MASK_CMP, "= 3" },
364371
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
365372
public static void testCompareULTMaskNotByte() {
@@ -375,6 +382,7 @@ public static void testCompareULTMaskNotByte() {
375382
@Test
376383
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
377384
IRNode.XOR_V, "= 0",
385+
IRNode.VECTOR_MASK_CAST, "= 1",
378386
IRNode.VECTOR_MASK_CMP, "= 3" },
379387
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
380388
public static void testCompareUGTMaskNotByte() {
@@ -390,6 +398,7 @@ public static void testCompareUGTMaskNotByte() {
390398
@Test
391399
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
392400
IRNode.XOR_V, "= 0",
401+
IRNode.VECTOR_MASK_CAST, "= 1",
393402
IRNode.VECTOR_MASK_CMP, "= 3" },
394403
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
395404
public static void testCompareULEMaskNotByte() {
@@ -405,6 +414,7 @@ public static void testCompareULEMaskNotByte() {
405414
@Test
406415
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
407416
IRNode.XOR_V, "= 0",
417+
IRNode.VECTOR_MASK_CAST, "= 1",
408418
IRNode.VECTOR_MASK_CMP, "= 3" },
409419
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
410420
public static void testCompareUGEMaskNotByte() {
@@ -421,6 +431,7 @@ public static void testCompareUGEMaskNotByte() {
421431
@Test
422432
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
423433
IRNode.XOR_V, "= 0",
434+
IRNode.VECTOR_MASK_CAST, "= 2",
424435
IRNode.VECTOR_MASK_CMP, "= 4" },
425436
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
426437
public static void testCompareEQMaskNotShort() {
@@ -438,6 +449,7 @@ public static void testCompareEQMaskNotShort() {
438449
@Test
439450
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
440451
IRNode.XOR_V, "= 0",
452+
IRNode.VECTOR_MASK_CAST, "= 2",
441453
IRNode.VECTOR_MASK_CMP, "= 4" },
442454
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
443455
public static void testCompareNEMaskNotShort() {
@@ -455,6 +467,7 @@ public static void testCompareNEMaskNotShort() {
455467
@Test
456468
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
457469
IRNode.XOR_V, "= 0",
470+
IRNode.VECTOR_MASK_CAST, "= 2",
458471
IRNode.VECTOR_MASK_CMP, "= 4" },
459472
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
460473
public static void testCompareLTMaskNotShort() {
@@ -472,6 +485,7 @@ public static void testCompareLTMaskNotShort() {
472485
@Test
473486
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
474487
IRNode.XOR_V, "= 0",
488+
IRNode.VECTOR_MASK_CAST, "= 2",
475489
IRNode.VECTOR_MASK_CMP, "= 4" },
476490
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
477491
public static void testCompareGTMaskNotShort() {
@@ -489,6 +503,7 @@ public static void testCompareGTMaskNotShort() {
489503
@Test
490504
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
491505
IRNode.XOR_V, "= 0",
506+
IRNode.VECTOR_MASK_CAST, "= 2",
492507
IRNode.VECTOR_MASK_CMP, "= 4" },
493508
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
494509
public static void testCompareLEMaskNotShort() {
@@ -506,6 +521,7 @@ public static void testCompareLEMaskNotShort() {
506521
@Test
507522
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
508523
IRNode.XOR_V, "= 0",
524+
IRNode.VECTOR_MASK_CAST, "= 2",
509525
IRNode.VECTOR_MASK_CMP, "= 4" },
510526
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
511527
public static void testCompareGEMaskNotShort() {
@@ -523,6 +539,7 @@ public static void testCompareGEMaskNotShort() {
523539
@Test
524540
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
525541
IRNode.XOR_V, "= 0",
542+
IRNode.VECTOR_MASK_CAST, "= 2",
526543
IRNode.VECTOR_MASK_CMP, "= 4" },
527544
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
528545
public static void testCompareULTMaskNotShort() {
@@ -540,6 +557,7 @@ public static void testCompareULTMaskNotShort() {
540557
@Test
541558
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
542559
IRNode.XOR_V, "= 0",
560+
IRNode.VECTOR_MASK_CAST, "= 2",
543561
IRNode.VECTOR_MASK_CMP, "= 4" },
544562
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
545563
public static void testCompareUGTMaskNotShort() {
@@ -557,6 +575,7 @@ public static void testCompareUGTMaskNotShort() {
557575
@Test
558576
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
559577
IRNode.XOR_V, "= 0",
578+
IRNode.VECTOR_MASK_CAST, "= 2",
560579
IRNode.VECTOR_MASK_CMP, "= 4" },
561580
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
562581
public static void testCompareULEMaskNotShort() {
@@ -574,6 +593,7 @@ public static void testCompareULEMaskNotShort() {
574593
@Test
575594
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
576595
IRNode.XOR_V, "= 0",
596+
IRNode.VECTOR_MASK_CAST, "= 2",
577597
IRNode.VECTOR_MASK_CMP, "= 4" },
578598
applyIfCPUFeatureOr = { "asimd", "true", "avx", "true", "rvv", "true" })
579599
public static void testCompareUGEMaskNotShort() {
@@ -592,6 +612,7 @@ public static void testCompareUGEMaskNotShort() {
592612
@Test
593613
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
594614
IRNode.XOR_V, "= 0",
615+
IRNode.VECTOR_MASK_CAST, "= 2",
595616
IRNode.VECTOR_MASK_CMP, "= 4" },
596617
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
597618
public static void testCompareEQMaskNotInt() {
@@ -609,6 +630,7 @@ public static void testCompareEQMaskNotInt() {
609630
@Test
610631
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
611632
IRNode.XOR_V, "= 0",
633+
IRNode.VECTOR_MASK_CAST, "= 2",
612634
IRNode.VECTOR_MASK_CMP, "= 4" },
613635
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
614636
public static void testCompareNEMaskNotInt() {
@@ -626,6 +648,7 @@ public static void testCompareNEMaskNotInt() {
626648
@Test
627649
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
628650
IRNode.XOR_V, "= 0",
651+
IRNode.VECTOR_MASK_CAST, "= 2",
629652
IRNode.VECTOR_MASK_CMP, "= 4" },
630653
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
631654
public static void testCompareLTMaskNotInt() {
@@ -643,6 +666,7 @@ public static void testCompareLTMaskNotInt() {
643666
@Test
644667
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
645668
IRNode.XOR_V, "= 0",
669+
IRNode.VECTOR_MASK_CAST, "= 2",
646670
IRNode.VECTOR_MASK_CMP, "= 4" },
647671
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
648672
public static void testCompareGTMaskNotInt() {
@@ -660,6 +684,7 @@ public static void testCompareGTMaskNotInt() {
660684
@Test
661685
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
662686
IRNode.XOR_V, "= 0",
687+
IRNode.VECTOR_MASK_CAST, "= 2",
663688
IRNode.VECTOR_MASK_CMP, "= 4" },
664689
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
665690
public static void testCompareLEMaskNotInt() {
@@ -677,6 +702,7 @@ public static void testCompareLEMaskNotInt() {
677702
@Test
678703
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
679704
IRNode.XOR_V, "= 0",
705+
IRNode.VECTOR_MASK_CAST, "= 2",
680706
IRNode.VECTOR_MASK_CMP, "= 4" },
681707
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
682708
public static void testCompareGEMaskNotInt() {
@@ -694,6 +720,7 @@ public static void testCompareGEMaskNotInt() {
694720
@Test
695721
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
696722
IRNode.XOR_V, "= 0",
723+
IRNode.VECTOR_MASK_CAST, "= 2",
697724
IRNode.VECTOR_MASK_CMP, "= 4" },
698725
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
699726
public static void testCompareULTMaskNotInt() {
@@ -711,6 +738,7 @@ public static void testCompareULTMaskNotInt() {
711738
@Test
712739
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
713740
IRNode.XOR_V, "= 0",
741+
IRNode.VECTOR_MASK_CAST, "= 2",
714742
IRNode.VECTOR_MASK_CMP, "= 4" },
715743
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
716744
public static void testCompareUGTMaskNotInt() {
@@ -728,6 +756,7 @@ public static void testCompareUGTMaskNotInt() {
728756
@Test
729757
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
730758
IRNode.XOR_V, "= 0",
759+
IRNode.VECTOR_MASK_CAST, "= 2",
731760
IRNode.VECTOR_MASK_CMP, "= 4" },
732761
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
733762
public static void testCompareULEMaskNotInt() {
@@ -745,6 +774,7 @@ public static void testCompareULEMaskNotInt() {
745774
@Test
746775
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
747776
IRNode.XOR_V, "= 0",
777+
IRNode.VECTOR_MASK_CAST, "= 2",
748778
IRNode.VECTOR_MASK_CMP, "= 4" },
749779
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
750780
public static void testCompareUGEMaskNotInt() {
@@ -763,6 +793,7 @@ public static void testCompareUGEMaskNotInt() {
763793
@Test
764794
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
765795
IRNode.XOR_V, "= 0",
796+
IRNode.VECTOR_MASK_CAST, "= 1",
766797
IRNode.VECTOR_MASK_CMP, "= 3" },
767798
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
768799
public static void testCompareEQMaskNotLong() {
@@ -778,6 +809,7 @@ public static void testCompareEQMaskNotLong() {
778809
@Test
779810
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
780811
IRNode.XOR_V, "= 0",
812+
IRNode.VECTOR_MASK_CAST, "= 1",
781813
IRNode.VECTOR_MASK_CMP, "= 3" },
782814
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
783815
public static void testCompareNEMaskNotLong() {
@@ -793,6 +825,7 @@ public static void testCompareNEMaskNotLong() {
793825
@Test
794826
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
795827
IRNode.XOR_V, "= 0",
828+
IRNode.VECTOR_MASK_CAST, "= 1",
796829
IRNode.VECTOR_MASK_CMP, "= 3" },
797830
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
798831
public static void testCompareLTMaskNotLong() {
@@ -808,6 +841,7 @@ public static void testCompareLTMaskNotLong() {
808841
@Test
809842
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
810843
IRNode.XOR_V, "= 0",
844+
IRNode.VECTOR_MASK_CAST, "= 1",
811845
IRNode.VECTOR_MASK_CMP, "= 3" },
812846
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
813847
public static void testCompareGTMaskNotLong() {
@@ -823,6 +857,7 @@ public static void testCompareGTMaskNotLong() {
823857
@Test
824858
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
825859
IRNode.XOR_V, "= 0",
860+
IRNode.VECTOR_MASK_CAST, "= 1",
826861
IRNode.VECTOR_MASK_CMP, "= 3" },
827862
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
828863
public static void testCompareLEMaskNotLong() {
@@ -838,6 +873,7 @@ public static void testCompareLEMaskNotLong() {
838873
@Test
839874
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
840875
IRNode.XOR_V, "= 0",
876+
IRNode.VECTOR_MASK_CAST, "= 1",
841877
IRNode.VECTOR_MASK_CMP, "= 3" },
842878
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
843879
public static void testCompareGEMaskNotLong() {
@@ -853,6 +889,7 @@ public static void testCompareGEMaskNotLong() {
853889
@Test
854890
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
855891
IRNode.XOR_V, "= 0",
892+
IRNode.VECTOR_MASK_CAST, "= 1",
856893
IRNode.VECTOR_MASK_CMP, "= 3" },
857894
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
858895
public static void testCompareULTMaskNotLong() {
@@ -868,6 +905,7 @@ public static void testCompareULTMaskNotLong() {
868905
@Test
869906
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
870907
IRNode.XOR_V, "= 0",
908+
IRNode.VECTOR_MASK_CAST, "= 1",
871909
IRNode.VECTOR_MASK_CMP, "= 3" },
872910
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
873911
public static void testCompareUGTMaskNotLong() {
@@ -883,6 +921,7 @@ public static void testCompareUGTMaskNotLong() {
883921
@Test
884922
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
885923
IRNode.XOR_V, "= 0",
924+
IRNode.VECTOR_MASK_CAST, "= 1",
886925
IRNode.VECTOR_MASK_CMP, "= 3" },
887926
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
888927
public static void testCompareULEMaskNotLong() {
@@ -898,6 +937,7 @@ public static void testCompareULEMaskNotLong() {
898937
@Test
899938
@IR(counts = { IRNode.XOR_V_MASK, "= 0",
900939
IRNode.XOR_V, "= 0",
940+
IRNode.VECTOR_MASK_CAST, "= 1",
901941
IRNode.VECTOR_MASK_CMP, "= 3" },
902942
applyIfCPUFeatureOr = { "asimd", "true", "avx2", "true", "rvv", "true" })
903943
public static void testCompareUGEMaskNotLong() {

0 commit comments

Comments
 (0)