Date
1  2 of 2
I have some questions about the VMADC/VMSBC instructions, thank you for your valuable comments.
lilei2@...
1. Question for tail bits of maskproducing instructions.
In the case of maskproducing instructions, tail elements are the bits with (vl <= bit index < VLEN).So according to riscvvspec1.0, page 46, VMADC/VMSBC instructions operate with tailagnostic policy, which means the tail bits can be written with 1 or unchanged.
While according to page 13, we have a more relax constraint: except for mask load instructions, any element in the tail of a mask result can also be written with the value the maskproducing operation would have calculated with vl=VLMAX. Which means we can overwritten all remaining bits that past vl with 1s or with the value the maskproducing operation would have calculated.
For example, if VLEN=128, LMUL=1, SEW=32, there are only 4 body bits for VMADC instruction. If current vl=2, we can write the calculation results to bit[1:0], and write all other 126 bits with 1s. Or we can write 4 bits calculation results to bit[3:0] in which only bit[1:0] are body bits, and write all other 124 bits with 1s.
Whether either of these implementations is legal?
2. Question for inactive body bits of maskproducing instructions.
When vtype.vma=0, which means maskundisturbed policy, the inactive body bits should retain its value.
For example, when vma=0, the VMSBF_M and VMSEQ with vm=0, should not change the inactive body bits.
Is my understand correct?thanks.


Andrew Waterman
On Thu, Jun 16, 2022 at 2:43 AM <lilei2@...> wrote:
It is legal to fill bits vl..VLEN1 with 1s because of the clause that these instructions are always tailagnostic.
It is also legal to compute bits 0..VLMAX1 (as a function of elements 0..VLMAX1), then fill bits VLMAX..VLEN1 with 1s, because of the clause that maskproducing instructions are permitted to write the result they would have written if vl had been set to VLMAX. But I'm not sure that the remark "in which only bit[1:0] are body bits" matters. In this style of implementation, the behavior is the same as if the body contained elements 0..VLMAX1.
Right.

