@@ -219,7 +219,7 @@ let TargetPrefix = "riscv" in {
219
219
let VLOperand = 2;
220
220
}
221
221
// For unit stride load with mask
222
- // Input: (maskedoff, pointer, mask, vl, ta )
222
+ // Input: (maskedoff, pointer, mask, vl, policy )
223
223
class RISCVUSLoadMask
224
224
: Intrinsic<[llvm_anyvector_ty ],
225
225
[LLVMMatchType<0>,
@@ -231,7 +231,7 @@ let TargetPrefix = "riscv" in {
231
231
let VLOperand = 3;
232
232
}
233
233
// For unit stride fault-only-first load with mask
234
- // Input: (maskedoff, pointer, mask, vl, ta )
234
+ // Input: (maskedoff, pointer, mask, vl, policy )
235
235
// Output: (data, vl)
236
236
// NOTE: We model this with default memory properties since we model writing
237
237
// VL as a side effect. IntrReadMem, IntrHasSideEffects does not work.
@@ -255,7 +255,7 @@ let TargetPrefix = "riscv" in {
255
255
let VLOperand = 3;
256
256
}
257
257
// For strided load with mask
258
- // Input: (maskedoff, pointer, stride, mask, vl, ta )
258
+ // Input: (maskedoff, pointer, stride, mask, vl, policy )
259
259
class RISCVSLoadMask
260
260
: Intrinsic<[llvm_anyvector_ty ],
261
261
[LLVMMatchType<0>,
@@ -277,7 +277,7 @@ let TargetPrefix = "riscv" in {
277
277
let VLOperand = 3;
278
278
}
279
279
// For indexed load with mask
280
- // Input: (maskedoff, pointer, index, mask, vl, ta )
280
+ // Input: (maskedoff, pointer, index, mask, vl, policy )
281
281
class RISCVILoadMask
282
282
: Intrinsic<[llvm_anyvector_ty ],
283
283
[LLVMMatchType<0>,
@@ -358,7 +358,7 @@ let TargetPrefix = "riscv" in {
358
358
let VLOperand = 2;
359
359
}
360
360
// For destination vector type is the same as first source vector (with mask).
361
- // Input: (vector_in, mask, vl, ta )
361
+ // Input: (vector_in, vector_in, mask, vl, policy )
362
362
class RISCVUnaryAAMask
363
363
: Intrinsic<[llvm_anyvector_ty],
364
364
[LLVMMatchType<0>, LLVMMatchType<0>,
@@ -367,7 +367,8 @@ let TargetPrefix = "riscv" in {
367
367
[ImmArg<ArgIndex<4>>, IntrNoMem]>, RISCVVIntrinsic {
368
368
let VLOperand = 3;
369
369
}
370
- class RISCVUnaryAAMaskTU
370
+ // Input: (passthru, vector_in, vector_in, mask, vl)
371
+ class RISCVCompress
371
372
: Intrinsic<[llvm_anyvector_ty],
372
373
[LLVMMatchType<0>, LLVMMatchType<0>,
373
374
LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyint_ty],
@@ -392,7 +393,7 @@ let TargetPrefix = "riscv" in {
392
393
let VLOperand = 3;
393
394
}
394
395
// For destination vector type is the same as first and second source vector.
395
- // Input: (vector_in, vector_in, int_vector_in, vl, ta )
396
+ // Input: (vector_in, vector_in, int_vector_in, vl, policy )
396
397
class RISCVRGatherVVMask
397
398
: Intrinsic<[llvm_anyvector_ty],
398
399
[LLVMMatchType<0>, LLVMMatchType<0>, LLVMVectorOfBitcastsToInt<0>,
@@ -411,7 +412,7 @@ let TargetPrefix = "riscv" in {
411
412
let VLOperand = 3;
412
413
}
413
414
// For destination vector type is the same as first and second source vector.
414
- // Input: (vector_in, vector_in, int16_vector_in, vl, ta )
415
+ // Input: (vector_in, vector_in, int16_vector_in, vl, policy )
415
416
class RISCVRGatherEI16VVMask
416
417
: Intrinsic<[llvm_anyvector_ty],
417
418
[LLVMMatchType<0>, LLVMMatchType<0>,
@@ -426,14 +427,14 @@ let TargetPrefix = "riscv" in {
426
427
// Input: (passthru, vector_in, xlen_in, vl)
427
428
class RISCVGatherVXNoMask
428
429
: Intrinsic<[llvm_anyvector_ty],
429
- [LLVMMatchType<0>, LLVMMatchType<0>, llvm_anyint_ty,
430
+ [LLVMMatchType<0>, LLVMMatchType<0>, llvm_anyint_ty,
430
431
LLVMMatchType<1>],
431
432
[IntrNoMem]>, RISCVVIntrinsic {
432
433
let VLOperand = 3;
433
434
}
434
435
// For destination vector type is the same as first source vector (with mask).
435
436
// Second operand is XLen.
436
- // Input: (maskedoff, vector_in, xlen_in, mask, vl, ta )
437
+ // Input: (maskedoff, vector_in, xlen_in, mask, vl, policy )
437
438
class RISCVGatherVXMask
438
439
: Intrinsic<[llvm_anyvector_ty],
439
440
[LLVMMatchType<0>, LLVMMatchType<0>, llvm_anyint_ty,
@@ -453,7 +454,7 @@ let TargetPrefix = "riscv" in {
453
454
let VLOperand = 3;
454
455
}
455
456
// For destination vector type is the same as first source vector (with mask).
456
- // Input: (maskedoff, vector_in, vector_in/scalar_in, mask, vl, ta )
457
+ // Input: (maskedoff, vector_in, vector_in/scalar_in, mask, vl, policy )
457
458
class RISCVBinaryAAXMask
458
459
: Intrinsic<[llvm_anyvector_ty],
459
460
[LLVMMatchType<0>, LLVMMatchType<0>, llvm_any_ty,
@@ -475,7 +476,7 @@ let TargetPrefix = "riscv" in {
475
476
}
476
477
// For destination vector type is the same as first source vector (with mask).
477
478
// The second source operand must match the destination type or be an XLen scalar.
478
- // Input: (maskedoff, vector_in, vector_in/scalar_in, mask, vl, ta )
479
+ // Input: (maskedoff, vector_in, vector_in/scalar_in, mask, vl, policy )
479
480
class RISCVBinaryAAShiftMask
480
481
: Intrinsic<[llvm_anyvector_ty],
481
482
[LLVMMatchType<0>, LLVMMatchType<0>, llvm_any_ty,
@@ -495,7 +496,7 @@ let TargetPrefix = "riscv" in {
495
496
let VLOperand = 3;
496
497
}
497
498
// For destination vector type is NOT the same as first source vector (with mask).
498
- // Input: (maskedoff, vector_in, vector_in/scalar_in, mask, vl, ta )
499
+ // Input: (maskedoff, vector_in, vector_in/scalar_in, mask, vl, policy )
499
500
class RISCVBinaryABXMask
500
501
: Intrinsic<[llvm_anyvector_ty],
501
502
[LLVMMatchType<0>, llvm_anyvector_ty, llvm_any_ty,
@@ -517,7 +518,7 @@ let TargetPrefix = "riscv" in {
517
518
}
518
519
// For destination vector type is NOT the same as first source vector (with mask).
519
520
// The second source operand must match the destination type or be an XLen scalar.
520
- // Input: (maskedoff, vector_in, vector_in/scalar_in, mask, vl, ta )
521
+ // Input: (maskedoff, vector_in, vector_in/scalar_in, mask, vl, policy )
521
522
class RISCVBinaryABShiftMask
522
523
: Intrinsic<[llvm_anyvector_ty],
523
524
[LLVMMatchType<0>, llvm_anyvector_ty, llvm_any_ty,
@@ -615,7 +616,7 @@ let TargetPrefix = "riscv" in {
615
616
}
616
617
// For Saturating binary operations with mask.
617
618
// The destination vector type is the same as first source vector.
618
- // Input: (maskedoff, vector_in, vector_in/scalar_in, mask, vl, ta )
619
+ // Input: (maskedoff, vector_in, vector_in/scalar_in, mask, vl, policy )
619
620
class RISCVSaturatingBinaryAAXMask
620
621
: Intrinsic<[llvm_anyvector_ty],
621
622
[LLVMMatchType<0>, LLVMMatchType<0>, llvm_any_ty,
@@ -639,7 +640,7 @@ let TargetPrefix = "riscv" in {
639
640
// For Saturating binary operations with mask.
640
641
// The destination vector type is the same as first source vector.
641
642
// The second source operand matches the destination type or is an XLen scalar.
642
- // Input: (maskedoff, vector_in, vector_in/scalar_in, mask, vl, ta )
643
+ // Input: (maskedoff, vector_in, vector_in/scalar_in, mask, vl, policy )
643
644
class RISCVSaturatingBinaryAAShiftMask
644
645
: Intrinsic<[llvm_anyvector_ty],
645
646
[LLVMMatchType<0>, LLVMMatchType<0>, llvm_any_ty,
@@ -662,7 +663,7 @@ let TargetPrefix = "riscv" in {
662
663
// For Saturating binary operations with mask.
663
664
// The destination vector type is NOT the same as first source vector (with mask).
664
665
// The second source operand matches the destination type or is an XLen scalar.
665
- // Input: (maskedoff, vector_in, vector_in/scalar_in, mask, vl, ta )
666
+ // Input: (maskedoff, vector_in, vector_in/scalar_in, mask, vl, policy )
666
667
class RISCVSaturatingBinaryABShiftMask
667
668
: Intrinsic<[llvm_anyvector_ty],
668
669
[LLVMMatchType<0>, llvm_anyvector_ty, llvm_any_ty,
@@ -671,13 +672,15 @@ let TargetPrefix = "riscv" in {
671
672
[ImmArg<ArgIndex<5>>, IntrNoMem, IntrHasSideEffects]>, RISCVVIntrinsic {
672
673
let VLOperand = 4;
673
674
}
675
+ // Input: (vector_in, vector_in, vector_in/scalar_in, vl)
674
676
class RISCVTernaryAAAXNoMask
675
677
: Intrinsic<[llvm_anyvector_ty],
676
678
[LLVMMatchType<0>, LLVMMatchType<0>, llvm_anyint_ty,
677
679
LLVMMatchType<1>],
678
680
[IntrNoMem]>, RISCVVIntrinsic {
679
681
let VLOperand = 3;
680
682
}
683
+ // Input: (vector_in, vector_in, vector_in/scalar_in, mask, vl, policy)
681
684
class RISCVTernaryAAAXMask
682
685
: Intrinsic<[llvm_anyvector_ty],
683
686
[LLVMMatchType<0>, LLVMMatchType<0>, llvm_anyint_ty,
@@ -686,6 +689,7 @@ let TargetPrefix = "riscv" in {
686
689
[ImmArg<ArgIndex<5>>, IntrNoMem]>, RISCVVIntrinsic {
687
690
let VLOperand = 4;
688
691
}
692
+ // NoMask Vector Multiply-Add operations, its first operand can not be undef.
689
693
// Input: (vector_in, vector_in/scalar, vector_in, vl, policy)
690
694
class RISCVTernaryAAXANoMask
691
695
: Intrinsic<[llvm_anyvector_ty],
@@ -695,6 +699,7 @@ let TargetPrefix = "riscv" in {
695
699
let ScalarOperand = 1;
696
700
let VLOperand = 3;
697
701
}
702
+ // Mask Vector Multiply-Add operations, its first operand can not be undef.
698
703
// Input: (vector_in, vector_in/scalar, vector_in, mask, vl, policy
699
704
class RISCVTernaryAAXAMask
700
705
: Intrinsic<[llvm_anyvector_ty],
@@ -705,6 +710,7 @@ let TargetPrefix = "riscv" in {
705
710
let ScalarOperand = 1;
706
711
let VLOperand = 4;
707
712
}
713
+ // NoMask Widening Vector Multiply-Add operations, its first operand can not be undef.
708
714
// Input: (vector_in, vector_in/scalar, vector_in, vl, policy)
709
715
class RISCVTernaryWideNoMask
710
716
: Intrinsic< [llvm_anyvector_ty],
@@ -714,6 +720,7 @@ let TargetPrefix = "riscv" in {
714
720
let ScalarOperand = 1;
715
721
let VLOperand = 3;
716
722
}
723
+ // Mask Widening Vector Multiply-Add operations, its first operand can not be undef.
717
724
// Input: (vector_in, vector_in/scalar, vector_in, mask, vl, policy
718
725
class RISCVTernaryWideMask
719
726
: Intrinsic< [llvm_anyvector_ty],
@@ -772,7 +779,7 @@ let TargetPrefix = "riscv" in {
772
779
let VLOperand = 2;
773
780
}
774
781
// For destination vector type is NOT the same as source vector (with mask).
775
- // Input: (maskedoff, vector_in, mask, vl, ta )
782
+ // Input: (maskedoff, vector_in, mask, vl, policy )
776
783
class RISCVUnaryABMask
777
784
: Intrinsic<[llvm_anyvector_ty],
778
785
[LLVMMatchType<0>, llvm_anyvector_ty,
@@ -824,7 +831,7 @@ let TargetPrefix = "riscv" in {
824
831
let VLOperand = 2;
825
832
}
826
833
// For Conversion unary operations with mask.
827
- // Input: (maskedoff, vector_in, mask, vl, ta )
834
+ // Input: (maskedoff, vector_in, mask, vl, policy )
828
835
class RISCVConversionMask
829
836
: Intrinsic<[llvm_anyvector_ty],
830
837
[LLVMMatchType<0>, llvm_anyvector_ty,
@@ -844,7 +851,7 @@ let TargetPrefix = "riscv" in {
844
851
let VLOperand = 1;
845
852
}
846
853
// For unit stride segment load with mask
847
- // Input: (maskedoff, pointer, mask, vl, ta )
854
+ // Input: (maskedoff, pointer, mask, vl, policy )
848
855
class RISCVUSSegLoadMask<int nf>
849
856
: Intrinsic<!listconcat([llvm_anyvector_ty], !listsplat(LLVMMatchType<0>,
850
857
!add(nf, -1))),
@@ -870,7 +877,7 @@ let TargetPrefix = "riscv" in {
870
877
let VLOperand = 1;
871
878
}
872
879
// For unit stride fault-only-first segment load with mask
873
- // Input: (maskedoff, pointer, mask, vl, ta )
880
+ // Input: (maskedoff, pointer, mask, vl, policy )
874
881
// Output: (data, vl)
875
882
// NOTE: We model this with default memory properties since we model writing
876
883
// VL as a side effect. IntrReadMem, IntrHasSideEffects does not work.
@@ -896,7 +903,7 @@ let TargetPrefix = "riscv" in {
896
903
let VLOperand = 2;
897
904
}
898
905
// For stride segment load with mask
899
- // Input: (maskedoff, pointer, offset, mask, vl, ta )
906
+ // Input: (maskedoff, pointer, offset, mask, vl, policy )
900
907
class RISCVSSegLoadMask<int nf>
901
908
: Intrinsic<!listconcat([llvm_anyvector_ty], !listsplat(LLVMMatchType<0>,
902
909
!add(nf, -1))),
@@ -920,7 +927,7 @@ let TargetPrefix = "riscv" in {
920
927
let VLOperand = 2;
921
928
}
922
929
// For indexed segment load with mask
923
- // Input: (maskedoff, pointer, index, mask, vl, ta )
930
+ // Input: (maskedoff, pointer, index, mask, vl, policy )
924
931
class RISCVISegLoadMask<int nf>
925
932
: Intrinsic<!listconcat([llvm_anyvector_ty], !listsplat(LLVMMatchType<0>,
926
933
!add(nf, -1))),
@@ -1360,7 +1367,7 @@ let TargetPrefix = "riscv" in {
1360
1367
defm vrgather_vx : RISCVRGatherVX;
1361
1368
defm vrgatherei16_vv : RISCVRGatherEI16VV;
1362
1369
1363
- def "int_riscv_vcompress" : RISCVUnaryAAMaskTU ;
1370
+ def "int_riscv_vcompress" : RISCVCompress ;
1364
1371
1365
1372
defm vaaddu : RISCVSaturatingBinaryAAX;
1366
1373
defm vaadd : RISCVSaturatingBinaryAAX;
0 commit comments