(no commit message)
[libreriscv.git] / openpower / sv / setvl.mdwn
index 66e6a3dbe1b8d55321e5722f1be8cb05a8151e8f..630fa711564d59d5037d4fffe9fa6ef03ec4a7bc 100644 (file)
@@ -6,6 +6,7 @@ See links:
 * <http://lists.libre-soc.org/pipermail/libre-soc-dev/2020-November/001366.html>
 * <https://bugs.libre-soc.org/show_bug.cgi?id=535>
 * <https://bugs.libre-soc.org/show_bug.cgi?id=587>
+* <https://bugs.libre-soc.org/show_bug.cgi?id=914> TODO: setvl should not set SO
 * <https://bugs.libre-soc.org/show_bug.cgi?id=568> TODO
 * <https://bugs.libre-soc.org/show_bug.cgi?id=927> bug - RT>=32
 * <https://bugs.libre-soc.org/show_bug.cgi?id=862> VF Predication
@@ -77,8 +78,8 @@ Note that in immediate setting mode VL and MVL start from **one** but that
 this is compensated for in the assembly notation.  i.e. that an immediate
 value of 1 in assembler notation actually places the value 0b0000000 in
 the `SVi` field bits: on execution the `setvl` instruction adds one to
-the decoded `SVi` field bits, resulting in VL/MVL being set to 1. This
-allows VL to be set to values ranging from 1 to 128 with only 7 bits
+the decoded `SVi` field bits, resulting in VL/MVL being set to 1. In future
+this will allow VL to be set to values ranging from 1 to 128 with only 7 bits
 instead of 8.  Setting VL/MVL to 0 would result in all Vector operations
 becoming `nop`.  If this is truly desired (nop behaviour) then setting
 VL and MVL to zero is to be done via the [[SVSTATE SPR|sv/sprs]].
@@ -166,7 +167,8 @@ loop:
 ### Loop using Rc=1
 
 In this example, the `setvl.` instruction enabled Rc=1, which
-sets CR0.eq when VL becomes zero.
+sets CR0.eq when VL becomes zero. Testing of `r4` (cmpi) is thus redundant
+saving one instruction.
 
 ```
     my_fn:
@@ -188,14 +190,15 @@ Up to 64 FPRs will be loaded, here.  `r3` is set one per bit for each
 FP register required to be loaded.  The block of memory from which the
 registers are loaded is contiguous (no gaps): any FP register which has
 a corresponding zero bit in `r3` is *unaltered*.  In essence this is a
-selective LD-multi with "Scatter" capability.
+selective LD-multi with "Scatter" (`VCOMPRESS`) capability.
 
 ```
     setvli r0, MVL=64, VL=64
     sv.fld/dm=r3 *r0, 0(r30) # selective load 64 FP registers
 ```
 
-Up to 64 FPRs will be saved, here.  Again, `r3` 
+Up to 64 FPRs will be saved, here.  Again, `r3` specifies which
+registers are set in a `VEXPAND` fashion.
 
 ```
     setvli r0, MVL=64, VL=64