(no commit message)
[libreriscv.git] / openpower / sv / branches.mdwn
index 3682e75d46b15abfa3fa83c74c43588bcb3e06a9..5259668acf125d54658c4c243893734278532dac 100644 (file)
@@ -450,6 +450,23 @@ This contrived construct is avoided by the behavioural inversion bits.
 
 # Pseudocode and examples
 
+For comparative purposes this is a copy of the v3.0B bc pseudocode,
+noting that M and AA have not been added to the SVP64 versions
+for simplicity of illustration.  ctr_ok does not appear in the SVP64
+versions because of the way that CTRtest Mode interacts.
+
+```
+if (mode_is_64bit) then M <- 0
+else M <- 32
+if ¬BO[2] then CTR <- CTR - 1
+ctr_ok <- BO[2] | ((CTR[M:63] != 0) ^ BO[3])
+cond_ok <- BO[0] | ¬(CR[BI+32] ^ BO[1])
+if ctr_ok & cond_ok then
+  if AA then NIA <-iea EXTS(BD || 0b00)
+  else       NIA <-iea CIA + EXTS(BD || 0b00)
+if LK then LR  <-iea  CIA + 4
+```
+
 Pseudocode for Horizontal-First Mode:
 
 ```