From: lkcl Date: Sat, 28 May 2022 18:54:55 +0000 (+0100) Subject: (no commit message) X-Git-Tag: opf_rfc_ls005_v1~2047 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c0a05d0dc7b02a52a913d3c3c05ac4cca474c603;p=libreriscv.git --- diff --git a/openpower/sv/branches.mdwn b/openpower/sv/branches.mdwn index 3ed17ab84..40dee32e1 100644 --- a/openpower/sv/branches.mdwn +++ b/openpower/sv/branches.mdwn @@ -561,14 +561,18 @@ cond_ok <- BO[0] | ¬(testbit ^ BO[1]) if ¬predicate_bit & ¬SVRMmode.sz then if ¬BO[2] & CTRtest & ¬CTi then CTR = CTR - 1 - stop # instruction finishes here -if ¬BO[2] & ¬(CTRtest & (cond_ok ^ CTi)) then CTR <- CTR - 1 -lr_ok <- LK -if ctr_ok & cond_ok then - if AA then NIA <-iea EXTS(BD || 0b00) - else NIA <-iea CIA + EXTS(BD || 0b00) - if SVRMmode.LRu then lr_ok <- ¬lr_ok -if lr_ok then LR <-iea CIA + 4 + # instruction finishes here +else + if ¬BO[2] & ¬(CTRtest & (cond_ok ^ CTi)) then CTR <- CTR - 1 + if VLSET and VSb = (cond_ok & ctr_ok) then + if SVRMmode.VLI then SVSTATE.VL = srcstep+1 + else SVSTATE.VL = srcstep + lr_ok <- LK + if ctr_ok & cond_ok then + if AA then NIA <-iea EXTS(BD || 0b00) + else NIA <-iea CIA + EXTS(BD || 0b00) + if SVRMmode.LRu then lr_ok <- ¬lr_ok + if lr_ok then LR <-iea CIA + 4 ``` Below is the pseudocode for SVP64 Branches, which is a little less @@ -611,10 +615,8 @@ for srcstep in range(VL): cond_ok |= (el_cond_ok & ctr_ok) # test for VL to be set (and exit) if VLSET and VSb = (el_cond_ok & ctr_ok) then - if SVRMmode.VLI - SVSTATE.VL = srcstep+1 - else - SVSTATE.VL = srcstep + if SVRMmode.VLI then SVSTATE.VL = srcstep+1 + else SVSTATE.VL = srcstep break # early exit? if SVRMmode.ALL != (el_cond_ok & ctr_ok):