From: lkcl Date: Sun, 23 Jun 2019 05:54:57 +0000 (+0100) Subject: (no commit message) X-Git-Tag: convert-csv-opcode-to-binary~4547 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8d523ac05c68e2751bcda0546631316ffd8f8658;p=libreriscv.git --- diff --git a/simple_v_extension/specification.mdwn b/simple_v_extension/specification.mdwn index af163d608..2d834fe47 100644 --- a/simple_v_extension/specification.mdwn +++ b/simple_v_extension/specification.mdwn @@ -861,6 +861,29 @@ reshaping and offsets and so on. However it demonstrates the basic principle. Augmentations that produce the full pseudo-code are covered in other sections. +## SUBVL Pseudocode + +Adding in support for SUBVL is a matter of adding in an extra inner for-loop, where register src and dest are still incremented inside the inner part. Not that the predication is still taken from the VL index. + +So whilst elements are indexed by (i * SUBVL + s), predicate bits are indexed by i + + function op_add(rd, rs1, rs2) # add not VADD! +  int i, id=0, irs1=0, irs2=0; +  predval = get_pred_val(FALSE, rd); +  rd = int_vec[rd ].isvector ? int_vec[rd ].regidx : rd; +  rs1 = int_vec[rs1].isvector ? int_vec[rs1].regidx : rs1; +  rs2 = int_vec[rs2].isvector ? int_vec[rs2].regidx : rs2; +  for (i = 0; i < VL; i++) + for (s = 0; s < SUBVL; s++) + if (predval & 1<