@@ -434,10 +434,9 @@ def Vector_ShuffleOp
434
434
The shuffle operation constructs a permutation (or duplication) of elements
435
435
from two input vectors, returning a vector with the same element type as
436
436
the input and a length that is the same as the shuffle mask. The two input
437
- vectors must have the same element type, same rank , and trailing dimension
438
- sizes and shuffles their values in the
439
- leading dimension (which may differ in size) according to the given mask.
440
- The legality rules are:
437
+ vectors must have the same element type, same rank, and trailing dimension
438
+ sizes and shuffles their values in the leading dimension (which may differ
439
+ in size) according to the given mask. The legality rules are:
441
440
* the two operands must have the same element type as the result
442
441
- Either, the two operands and the result must have the same
443
442
rank and trailing dimension sizes, viz. given two k-D operands
@@ -448,7 +447,9 @@ def Vector_ShuffleOp
448
447
* the mask length equals the leading dimension size of the result
449
448
* numbering the input vector indices left to right across the operands, all
450
449
mask values must be within range, viz. given two k-D operands v1 and v2
451
- above, all mask values are in the range [0,s_1+t_1)
450
+ above, all mask values are in the range [0,s_1+t_1). The value `-1`
451
+ represents a poison mask value, which specifies that the selected element
452
+ is poison.
452
453
453
454
Note, scalable vectors are not supported.
454
455
@@ -463,10 +464,15 @@ def Vector_ShuffleOp
463
464
: vector<2xf32>, vector<2xf32> ; yields vector<4xf32>
464
465
%3 = vector.shuffle %a, %b[0, 1]
465
466
: vector<f32>, vector<f32> ; yields vector<2xf32>
467
+ %4 = vector.shuffle %a, %b[0, 4, -1, -1, -1, -1]
468
+ : vector<4xf32>, vector<4xf32> ; yields vector<6xf32>
466
469
```
467
470
}];
468
471
469
472
let extraClassDeclaration = [{
473
+ // Integer to represent a poison value in a vector shuffle mask.
474
+ static constexpr int64_t kMaskPoisonValue = -1;
475
+
470
476
VectorType getV1VectorType() {
471
477
return ::llvm::cast<VectorType>(getV1().getType());
472
478
}
@@ -700,6 +706,8 @@ def Vector_ExtractOp :
700
706
%4 = vector.extract %0[%a, %b, %c]: f32 from vector<4x8x16xf32>
701
707
%5 = vector.extract %0[2, %b]: vector<16xf32> from vector<4x8x16xf32>
702
708
```
709
+
710
+ TODO: Implement support for poison indices.
703
711
}];
704
712
705
713
let arguments = (ins
@@ -890,6 +898,8 @@ def Vector_InsertOp :
890
898
%11 = vector.insert %9, %10[%a, %b, %c] : vector<f32> into vector<4x8x16xf32>
891
899
%12 = vector.insert %4, %10[2, %b] : vector<16xf32> into vector<4x8x16xf32>
892
900
```
901
+
902
+ TODO: Implement support for poison indices.
893
903
}];
894
904
895
905
let arguments = (ins
@@ -980,6 +990,8 @@ def Vector_ScalableInsertOp :
980
990
```mlir
981
991
%2 = vector.scalable.insert %0, %1[5] : vector<4xf32> into vector<[16]xf32>
982
992
```
993
+
994
+ TODO: Implement support for poison indices.
983
995
}];
984
996
985
997
let assemblyFormat = [{
@@ -1031,6 +1043,8 @@ def Vector_ScalableExtractOp :
1031
1043
```mlir
1032
1044
%1 = vector.scalable.extract %0[5] : vector<4xf32> from vector<[16]xf32>
1033
1045
```
1046
+
1047
+ TODO: Implement support for poison indices.
1034
1048
}];
1035
1049
1036
1050
let assemblyFormat = [{
@@ -1075,6 +1089,8 @@ def Vector_InsertStridedSliceOp :
1075
1089
{offsets = [0, 0, 2], strides = [1, 1]}:
1076
1090
vector<2x4xf32> into vector<16x4x8xf32>
1077
1091
```
1092
+
1093
+ TODO: Implement support for poison indices.
1078
1094
}];
1079
1095
1080
1096
let assemblyFormat = [{
@@ -1220,6 +1236,8 @@ def Vector_ExtractStridedSliceOp :
1220
1236
%1 = vector.extract_strided_slice %0[0:2:1][2:4:1]
1221
1237
vector<4x8x16xf32> to vector<2x4x16xf32>
1222
1238
```
1239
+
1240
+ TODO: Implement support for poison indices.
1223
1241
}];
1224
1242
let builders = [
1225
1243
OpBuilder<(ins "Value":$source, "ArrayRef<int64_t>":$offsets,
0 commit comments