\newpage{}
-# svshape2 (offset) <a name="svshape2"> </a>
+# svshape2 (offset-priority) <a name="svshape2"> </a>
+
+SVM2-Form
+
+| 0-5|6-9 |10|11-15 |16-20 | 21-24 | 25 | 26-31 | Form |
+| -- |----|--| --- | ----- | ------ | -- | ------| -------- |
+| PO |offs|yx| rmm | SVd | 100/mm | sk | XO | SVM2-Form |
+
+* svshape2 offs,yx,rmm,SVd,sk,mm
+
+Pseudo-code:
+
+```
+ # based on nearest MAXVL compute other dimension
+ MVL <- SVSTATE[0:6]
+ d <- [0] * 6
+ dim <- SVd+1
+ do while d*dim <u ([0]*4 || MVL)
+ d <- d + 1
+ # set up template, then copy once location identified
+ shape <- [0]*32
+ shape[30:31] <- 0b00 # mode
+ shape[0:5] <- (0b0 || SVd) # x/ydim
+ if SVyx = 0 then
+ shape[18:20] <- 0b000 # ordering xd/yd(/zd)
+ if sk = 0 then shape[6:11] <- 0 # ydim
+ else shape[6:11] <- 0b111111 # ydim max
+ else
+ shape[18:20] <- 0b010 # ordering yd/xd(/zd)
+ if sk = 1 then shape[6:11] <- 0 # ydim
+ else shape[6:11] <- d-1 # ydim max
+ # offset (the prime purpose of this instruction)
+ shape[24:27] <- SVo # offset
+ if sk = 1 then shape[28:29] <- 0b01 # skip 1st dimension
+ else shape[28:29] <- 0b00 # no skipping
+ # select the mode for updating SVSHAPEs
+ SVSTATE[62] <- mm # set or clear persistence
+ if mm = 0 then
+ # clear out all SVSHAPEs first
+ SVSHAPE0[0:31] <- [0] * 32
+ SVSHAPE1[0:31] <- [0] * 32
+ SVSHAPE2[0:31] <- [0] * 32
+ SVSHAPE3[0:31] <- [0] * 32
+ SVSTATE[32:41] <- [0] * 10 # clear REMAP.mi/o
+ SVSTATE[42:46] <- rmm # rmm exactly REMAP.SVme
+ idx <- 0
+ for bit = 0 to 4
+ if rmm[4-bit] then
+ # activate requested shape
+ if idx = 0 then SVSHAPE0 <- shape
+ if idx = 1 then SVSHAPE1 <- shape
+ if idx = 2 then SVSHAPE2 <- shape
+ if idx = 3 then SVSHAPE3 <- shape
+ SVSTATE[bit*2+32:bit*2+33] <- idx
+ # increment shape index, modulo 4
+ if idx = 3 then idx <- 0
+ else idx <- idx + 1
+ else
+ # refined SVSHAPE/REMAP update mode
+ bit <- rmm[0:2]
+ idx <- rmm[3:4]
+ if idx = 0 then SVSHAPE0 <- shape
+ if idx = 1 then SVSHAPE1 <- shape
+ if idx = 2 then SVSHAPE2 <- shape
+ if idx = 3 then SVSHAPE3 <- shape
+ SVSTATE[bit*2+32:bit*2+33] <- idx
+ SVSTATE[46-bit] <- 1
+```
+
+Special Registers Altered:
+
+```
+ None
+```
`svshape2` is an additional convenience instruction that prioritises
setting `SVSHAPE.offset`. Its primary purpose is for use when
through LD/ST. `SVSHAPE.offset` caters for this scenario and `svshape2`is
makes it easier.
- svshape2 offs,yx,rmm,SVd,sk,mm
-
-| 0.5|6..9|10|11.15 |16..20 | 21..25 | 25 | 26..31| name |
-| -- |----|--| --- | ----- | ------ | -- | ------| -------- |
-|OPCD|offs|yx| rmm | SVd | 100/mm | sk | XO | svshape |
+**Operand Fields**:
* **offs** (4 bits) - unsigned offset
* **yx** (1 bit) - swap XY to YX
# Forms
+Add `SVI, SVM, SVM2, SVRM` to `XO (26:31)` Field in Book I, 1.6.2
+
Add the following to Book I, 1.6.1, SVI-Form
```
| PO | SVme |mi0 | mi1 | mi2 | mo0 | mo1 |pst |/// | XO |
```
-* Add `SVI, SVM, SVM2, SVRM` to `XO (26:31)` Field in Book I, 1.6.2
-
Add the following to Book I, 1.6.2
```
| Form | Book | Page | Version | mnemonic | Description |
|------|------|------|---------|----------|-------------|
| SVRM | I | # | 3.0B | svremap | REMAP enabling instruction |
+| SVM | I | # | 3.0B | svshape | REMAP shape instruction |
+| SVM2 | I | # | 3.0B | svshape2 | REMAP shape instruction (2) |
+| SVI | I | # | 3.0B | svindex | REMAP General-purpose Indexing |
[[!tag opf_rfc]]