|
2 | 2 | == Zvvm Family of Integrated Matrix Extensions |
3 | 3 |
|
4 | 4 | :stem: latexmath |
| 5 | +:imagesdir: ../docs-resources/images |
5 | 6 | :imagesdir: images |
6 | 7 |
|
7 | 8 | === Introduction |
@@ -1116,8 +1117,14 @@ The tile load and store instructions make use of the following parameters from t |
1116 | 1117 | * LMUL — vector length multiplier |
1117 | 1118 | * λ — selected lambda, read from `lambda[2:0]` in `vtype` |
1118 | 1119 |
|
1119 | | -The resulting tile dimensions are μ = ν = VL/λ, with the accumulator tile C occupying MUL = LMUL/λ² vector registers. |
1120 | 1120 | When loading A or B input tiles, `vmtl.v` and `vmttl.v` shall be used with SEW equal to the element width of the C accumulator tile. |
| 1121 | +<<#ime-load-store-geometry>> illustrates the memory to VR load for both row-major and column-major order for a tile with LMUL=1. |
| 1122 | +Physically both transfers are identical: they move contiguous segments of length _linesize_ = λ × LMUL with a stride of LD between them. |
| 1123 | +The tile load/store instructions interpret the memory layout according to the specified leading dimension, but the resulting data layout in the VR is the same regardless of whether the source/destination matrix is stored in row-major or column-major order. |
| 1124 | + |
| 1125 | +[#ime-load-store-geometry] |
| 1126 | +.Loading a matrix tile from memory for LMUL=1. The matrix is layed out linearly in memory, the leading dimension LD specifies its row size (a) or column size (b). Element indices represent the offset of the elements in memory. Blue arrows indicate the data ordering in memory/VR. |
| 1127 | +image::png/ime-load-store-geometry.png[align="center"] |
1121 | 1128 |
|
1122 | 1129 | If (rs2) = 0, then the leading dimension LD is set to the _natural dimension_ of λ × LMUL. |
1123 | 1130 | That is, the memory layout, with elements contiguous to each other, matches the layout of the register group being loaded/stored. |
@@ -1188,6 +1195,14 @@ For each element index `i` in the body `[vstart, VL)` where the mask is enabled: |
1188 | 1195 |
|
1189 | 1196 | M[rs1 + (SEW ÷ 8) × ((i / linesize) × LD + (i % linesize))] = VS[i] |
1190 | 1197 |
|
| 1198 | +[NOTE] |
| 1199 | +==== |
| 1200 | +Order preserving tile load/store with LMUL > 1 offers optimization opportunities. While vmtl/vmts are very similar to vector constant-stride segment operations, the segment sizes are potentially larger. Matching cache line size with λ × LMUL × SEW allows for full cacheline transfers. |
| 1201 | +==== |
| 1202 | +[#ime-vmtls-lmul] |
| 1203 | +.Order preserving tile load/store with LMUL > 1 for row-major (a) and column-major ordering in memory. |
| 1204 | +image::png/ime-vmtls-lmul.png[align="center", width="90%"] |
| 1205 | + |
1191 | 1206 | ===== `vmttl.v` — Transposing Tile Load |
1192 | 1207 |
|
1193 | 1208 | vmttl.v vd, (rs1), rs2 [, Lλ] [, vm] |
@@ -3410,3 +3425,4 @@ Included in:: |
3410 | 3425 | |0.1 |
3411 | 3426 | |Draft |
3412 | 3427 | |=== |
| 3428 | + |
0 commit comments