opportunities
* CTR-testing
-Both are outlined below.
+Both are outlined below, in later sections.
# Horizontal-First and Vertical-First Modes
* `sv.bc` When LRu=0,LK=0, Link Register is not updated
* `sv.bcl` When LRu=0,LK=1, Link Register is updated unconditionally
* `sv.bcl/lru` When LRu=1,LK=1, Link Register will
- only be updated if the Branch Condition succeeds.
+ only be updated if the Branch Condition fails.
* `sv.bc/lru` When LRu=1,LK=0, Link Register will only be updated if
- the Branch Condition fails.
+ the Branch Condition succeeds.
This avoids
destruction of LR during loops (particularly Vertical-First
if SVCRf.scalar:
break
# loop finally done, now test if branch (and update LR)
-lr_ok <- SVRMmode.LRu
+lr_ok <- LK
if cond_ok then
if AA then NIA <-iea EXTS(BD || 0b00)
else NIA <-iea CIA + EXTS(BD || 0b00)
- lr_ok <- ¬lr_ok
-if (LK & lr_ok) | (¬LK & lr_ok) then LR <-iea CIA + 4
+ if SVRMmode.LRu then lr_ok <- ¬lr_ok
+if lr_ok then LR <-iea CIA + 4
```
Pseudocode for Vertical-First Mode:
...
...
cond_ok <- BO[0] | ¬(CR[BI+32] ^ BO[1])
+ lr_ok <- LK
if ctr_ok & cond_ok then
NIA <-iea LR[0:61] || 0b00
- lr_ok = ¬lr_ok
- if (LK & lr_ok) | (¬LK & lr_ok) then LR <-iea CIA + 4
+ if SVRMmode.LRu then lr_ok <- ¬lr_ok
+ if lr_ok then LR <-iea CIA + 4
+ # if NIA modified exit loop
```
The reason why should be clear from this being a Vector loop: