Skip to content

Commit 1f7aea8

Browse files
committed
Updated SAIL for tile loads/stores when (rs2) == 0
1 parent e226c6b commit 1f7aea8

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

src/integrated-matrix.adoc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2638,6 +2638,7 @@ Encoding::
26382638
Description::
26392639
Loads a 2D matrix tile from memory into the vector register group starting at _vd_.
26402640
_rs1_ holds the matrix base address; _rs2_ holds the leading dimension `LD` in elements.
2641+
if _rs2_ holds zero (0), the leading dimension `LD` is set to λ × LMUL.
26412642
When _Lλ_ is specified, it overrides `lambda[2:0]` from `vtype` for this instruction.
26422643
Inactive elements (masked off) are not updated unless `vtype.vma`=1 (mask-agnostic), in which case they may be overwritten with 1s.
26432644
Tail elements (index ≥ VL) are not updated unless `vtype.vta`=1 (tail-agnostic), in which case they may be overwritten with 1s.
@@ -2677,6 +2678,10 @@ let LD : int = unsigned(X(rs2));
26772678
let vm_val = read_vmask(num_elem, vm, zvreg);
26782679
let linesize : int = eff_lambda * LMUL;
26792680

2681+
if LD == 0 then {
2682+
LD = eff_lambda * LMUL;
2683+
}
2684+
26802685
foreach (i from 0 to (num_elem - 1)) {
26812686
if vm_val[i] == 0b1 then {
26822687
set_vstart(to_bits_unsafe(16, i));
@@ -2737,6 +2742,7 @@ Encoding::
27372742
Description::
27382743
Stores the 2D matrix tile held in the vector register group starting at _vs3_ to memory.
27392744
_rs1_ holds the matrix base address; _rs2_ holds the leading dimension `LD` in elements.
2745+
if _rs2_ holds zero (0), the leading dimension `LD` is set to λ × LMUL.
27402746
When _Lλ_ is specified, it overrides `lambda[2:0]` from `vtype` for this instruction.
27412747
Inactive elements (masked off) are not written to memory and do not raise exceptions.
27422748
Tail elements (index ≥ VL) are not written to memory and do not raise exceptions.
@@ -2770,6 +2776,10 @@ let LD : int = unsigned(X(rs2));
27702776
let vm_val = read_vmask(num_elem, vm, zvreg);
27712777
let linesize : int = eff_lambda * LMUL;
27722778

2779+
if LD == 0 then {
2780+
LD = eff_lambda * LMUL;
2781+
}
2782+
27732783
foreach (i from 0 to (num_elem - 1)) {
27742784
if vm_val[i] == 0b1 then {
27752785
set_vstart(to_bits_unsafe(16, i));
@@ -2833,6 +2843,7 @@ required by the matrix multiplier.
28332843
This instruction is used when a B tile is stored in row-major order, or when an A or C tile
28342844
is stored in column-major order in memory.
28352845
_rs1_ holds the matrix base address; _rs2_ holds the leading dimension `LD` in elements.
2846+
if _rs2_ holds zero (0), the leading dimension `LD` is set to λ × LMUL.
28362847
When _Lλ_ is specified, it overrides `lambda[2:0]` from `vtype` for this instruction.
28372848
Inactive elements (masked off) are not updated unless `vtype.vma`=1 (mask-agnostic), in which case they may be overwritten with 1s.
28382849
Tail elements (index ≥ VL) are not updated unless `vtype.vta`=1 (tail-agnostic), in which case they may be overwritten with 1s.
@@ -2867,6 +2878,10 @@ let LD : int = unsigned(X(rs2));
28672878
let vm_val = read_vmask(num_elem, vm, zvreg);
28682879
let linesize : int = eff_lambda * LMUL;
28692880

2881+
if LD == 0 then {
2882+
LD = eff_lambda * LMUL;
2883+
}
2884+
28702885
foreach (i from 0 to (num_elem - 1)) {
28712886
if vm_val[i] == 0b1 then {
28722887
set_vstart(to_bits_unsafe(16, i));
@@ -2929,6 +2944,7 @@ Description::
29292944
Stores a 2D matrix tile from vector registers to memory, applying the inverse transposition
29302945
of `vmttl.v`.
29312946
_rs1_ holds the matrix base address; _rs2_ holds the leading dimension `LD` in elements.
2947+
if _rs2_ holds zero (0), the leading dimension `LD` is set to λ × LMUL.
29322948
When _Lλ_ is specified, it overrides `lambda[2:0]` from `vtype` for this instruction.
29332949
Inactive elements (masked off) are not written to memory and do not raise exceptions.
29342950
Tail elements (index ≥ VL) are not written to memory and do not raise exceptions.
@@ -2962,6 +2978,10 @@ let LD : int = unsigned(X(rs2));
29622978
let vm_val = read_vmask(num_elem, vm, zvreg);
29632979
let linesize : int = eff_lambda * LMUL;
29642980

2981+
if LD == 0 then {
2982+
LD = eff_lambda * LMUL;
2983+
}
2984+
29652985
foreach (i from 0 to (num_elem - 1)) {
29662986
if vm_val[i] == 0b1 then {
29672987
set_vstart(to_bits_unsafe(16, i));

0 commit comments

Comments
 (0)