@@ -1574,11 +1574,14 @@ def Vector_MaskedLoadOp :
1574
1574
closely correspond to those of the `llvm.masked.load`
1575
1575
[intrinsic](https://llvm.org/docs/LangRef.html#llvm-masked-load-intrinsics).
1576
1576
1577
- Example :
1577
+ Examples :
1578
1578
1579
1579
```mlir
1580
1580
%0 = vector.maskedload %base[%i], %mask, %pass_thru
1581
1581
: memref<?xf32>, vector<8xi1>, vector<8xf32> into vector<8xf32>
1582
+
1583
+ %1 = vector.maskedload %base[%i, %j], %mask, %pass_thru
1584
+ : memref<?x?xf32>, vector<16xi1>, vector<16xf32> into vector<16xf32>
1582
1585
```
1583
1586
}];
1584
1587
let extraClassDeclaration = [{
@@ -1625,11 +1628,14 @@ def Vector_MaskedStoreOp :
1625
1628
closely correspond to those of the `llvm.masked.store`
1626
1629
[intrinsic](https://llvm.org/docs/LangRef.html#llvm-masked-store-intrinsics).
1627
1630
1628
- Example :
1631
+ Examples :
1629
1632
1630
1633
```mlir
1631
1634
vector.maskedstore %base[%i], %mask, %value
1632
1635
: memref<?xf32>, vector<8xi1>, vector<8xf32>
1636
+
1637
+ vector.maskedstore %base[%i, %j], %mask, %value
1638
+ : memref<?x?xf32>, vector<16xi1>, vector<16xf32>
1633
1639
```
1634
1640
}];
1635
1641
let extraClassDeclaration = [{
@@ -1652,7 +1658,8 @@ def Vector_MaskedStoreOp :
1652
1658
def Vector_GatherOp :
1653
1659
Vector_Op<"gather">,
1654
1660
Arguments<(ins Arg<AnyMemRef, "", [MemRead]>:$base,
1655
- VectorOfRankAndType<[1], [AnyInteger]>:$indices,
1661
+ Variadic<Index>:$indices,
1662
+ VectorOfRankAndType<[1], [AnyInteger]>:$index_vec,
1656
1663
VectorOfRankAndType<[1], [I1]>:$mask,
1657
1664
VectorOfRank<[1]>:$pass_thru)>,
1658
1665
Results<(outs VectorOfRank<[1]>:$result)> {
@@ -1661,9 +1668,10 @@ def Vector_GatherOp :
1661
1668
1662
1669
let description = [{
1663
1670
The gather operation gathers elements from memory into a 1-D vector as
1664
- defined by a base and a 1-D index vector, but only if the corresponding
1665
- bit is set in a 1-D mask vector. Otherwise, the element is taken from a
1666
- 1-D pass-through vector. Informally the semantics are:
1671
+ defined by a base with indices and an additional 1-D index vector, but
1672
+ only if the corresponding bit is set in a 1-D mask vector. Otherwise, the
1673
+ element is taken from a 1-D pass-through vector. Informally the semantics
1674
+ are:
1667
1675
```
1668
1676
result[0] := mask[0] ? base[index[0]] : pass_thru[0]
1669
1677
result[1] := mask[1] ? base[index[1]] : pass_thru[1]
@@ -1677,19 +1685,22 @@ def Vector_GatherOp :
1677
1685
correspond to those of the `llvm.masked.gather`
1678
1686
[intrinsic](https://llvm.org/docs/LangRef.html#llvm-masked-gather-intrinsics).
1679
1687
1680
- Example :
1688
+ Examples :
1681
1689
1682
1690
```mlir
1683
- %g = vector.gather %base[%indices ], %mask, %pass_thru
1691
+ %0 = vector.gather %base[%c0][%v ], %mask, %pass_thru
1684
1692
: memref<?xf32>, vector<16xi32>, vector<16xi1>, vector<16xf32> into vector<16xf32>
1693
+
1694
+ %1 = vector.gather %base[%i, %j][%v], %mask, %pass_thru
1695
+ : memref<16x16xf32>, vector<16xi32>, vector<16xi1>, vector<16xf32> into vector<16xf32>
1685
1696
```
1686
1697
}];
1687
1698
let extraClassDeclaration = [{
1688
1699
MemRefType getMemRefType() {
1689
1700
return base().getType().cast<MemRefType>();
1690
1701
}
1691
- VectorType getIndicesVectorType () {
1692
- return indices ().getType().cast<VectorType>();
1702
+ VectorType getIndexVectorType () {
1703
+ return index_vec ().getType().cast<VectorType>();
1693
1704
}
1694
1705
VectorType getMaskVectorType() {
1695
1706
return mask().getType().cast<VectorType>();
@@ -1701,25 +1712,29 @@ def Vector_GatherOp :
1701
1712
return result().getType().cast<VectorType>();
1702
1713
}
1703
1714
}];
1704
- let assemblyFormat = "$base `[` $indices `]` `,` $mask `,` $pass_thru attr-dict `:` "
1705
- "type($base) `,` type($indices) `,` type($mask) `,` type($pass_thru) `into` type($result)";
1715
+ let assemblyFormat =
1716
+ "$base `[` $indices `]` `[` $index_vec `]` `,` "
1717
+ "$mask `,` $pass_thru attr-dict `:` type($base) `,` "
1718
+ "type($index_vec) `,` type($mask) `,` type($pass_thru) "
1719
+ "`into` type($result)";
1706
1720
let hasCanonicalizer = 1;
1707
1721
}
1708
1722
1709
1723
def Vector_ScatterOp :
1710
1724
Vector_Op<"scatter">,
1711
1725
Arguments<(ins Arg<AnyMemRef, "", [MemWrite]>:$base,
1712
- VectorOfRankAndType<[1], [AnyInteger]>:$indices,
1726
+ Variadic<Index>:$indices,
1727
+ VectorOfRankAndType<[1], [AnyInteger]>:$index_vec,
1713
1728
VectorOfRankAndType<[1], [I1]>:$mask,
1714
1729
VectorOfRank<[1]>:$valueToStore)> {
1715
1730
1716
1731
let summary = "scatters elements from a vector into memory as defined by an index vector and mask";
1717
1732
1718
1733
let description = [{
1719
1734
The scatter operation scatters elements from a 1-D vector into memory as
1720
- defined by a base and a 1-D index vector, but only if the corresponding
1721
- bit in a 1-D mask vector is set. Otherwise, no action is taken for that
1722
- element. Informally the semantics are:
1735
+ defined by a base with indices and an additional 1-D index vector, but
1736
+ only if the corresponding bit in a 1-D mask vector is set. Otherwise, no
1737
+ action is taken for that element. Informally the semantics are:
1723
1738
```
1724
1739
if (mask[0]) base[index[0]] = value[0]
1725
1740
if (mask[1]) base[index[1]] = value[1]
@@ -1736,19 +1751,22 @@ def Vector_ScatterOp :
1736
1751
correspond to those of the `llvm.masked.scatter`
1737
1752
[intrinsic](https://llvm.org/docs/LangRef.html#llvm-masked-scatter-intrinsics).
1738
1753
1739
- Example :
1754
+ Examples :
1740
1755
1741
1756
```mlir
1742
- vector.scatter %base[%indices ], %mask, %value
1757
+ vector.scatter %base[%c0][%v ], %mask, %value
1743
1758
: memref<?xf32>, vector<16xi32>, vector<16xi1>, vector<16xf32>
1759
+
1760
+ vector.scatter %base[%i, %j][%v], %mask, %value
1761
+ : memref<16x16xf32>, vector<16xi32>, vector<16xi1>, vector<16xf32>
1744
1762
```
1745
1763
}];
1746
1764
let extraClassDeclaration = [{
1747
1765
MemRefType getMemRefType() {
1748
1766
return base().getType().cast<MemRefType>();
1749
1767
}
1750
- VectorType getIndicesVectorType () {
1751
- return indices ().getType().cast<VectorType>();
1768
+ VectorType getIndexVectorType () {
1769
+ return index_vec ().getType().cast<VectorType>();
1752
1770
}
1753
1771
VectorType getMaskVectorType() {
1754
1772
return mask().getType().cast<VectorType>();
@@ -1758,8 +1776,9 @@ def Vector_ScatterOp :
1758
1776
}
1759
1777
}];
1760
1778
let assemblyFormat =
1761
- "$base `[` $indices `]` `,` $mask `,` $valueToStore attr-dict `:` "
1762
- "type($base) `,` type($indices) `,` type($mask) `,` type($valueToStore)";
1779
+ "$base `[` $indices `]` `[` $index_vec `]` `,` "
1780
+ "$mask `,` $valueToStore attr-dict `:` type($base) `,` "
1781
+ "type($index_vec) `,` type($mask) `,` type($valueToStore)";
1763
1782
let hasCanonicalizer = 1;
1764
1783
}
1765
1784
@@ -1792,11 +1811,14 @@ def Vector_ExpandLoadOp :
1792
1811
correspond to those of the `llvm.masked.expandload`
1793
1812
[intrinsic](https://llvm.org/docs/LangRef.html#llvm-masked-expandload-intrinsics).
1794
1813
1795
- Example :
1814
+ Examples :
1796
1815
1797
1816
```mlir
1798
1817
%0 = vector.expandload %base[%i], %mask, %pass_thru
1799
1818
: memref<?xf32>, vector<8xi1>, vector<8xf32> into vector<8xf32>
1819
+
1820
+ %1 = vector.expandload %base[%i, %j], %mask, %pass_thru
1821
+ : memref<?x?xf32>, vector<16xi1>, vector<16xf32> into vector<16xf32>
1800
1822
```
1801
1823
}];
1802
1824
let extraClassDeclaration = [{
@@ -1846,11 +1868,14 @@ def Vector_CompressStoreOp :
1846
1868
correspond to those of the `llvm.masked.compressstore`
1847
1869
[intrinsic](https://llvm.org/docs/LangRef.html#llvm-masked-compressstore-intrinsics).
1848
1870
1849
- Example :
1871
+ Examples :
1850
1872
1851
1873
```mlir
1852
1874
vector.compressstore %base[%i], %mask, %value
1853
1875
: memref<?xf32>, vector<8xi1>, vector<8xf32>
1876
+
1877
+ vector.compressstore %base[%i, %j], %mask, %value
1878
+ : memref<?x?xf32>, vector<16xi1>, vector<16xf32>
1854
1879
```
1855
1880
}];
1856
1881
let extraClassDeclaration = [{
0 commit comments