From 69e98b1fffc88b1a34181e71e601e3669bd3098f Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 27 Jan 2024 12:50:05 +0000 Subject: [PATCH] bug 1034: update spec page on bin/tern lut2/lut3 --- openpower/sv/tern_bin.mdwn | 72 ++++++++++++++++++++++++++++++++++---- 1 file changed, 66 insertions(+), 6 deletions(-) diff --git a/openpower/sv/tern_bin.mdwn b/openpower/sv/tern_bin.mdwn index 124e1765d..549ebe1eb 100644 --- a/openpower/sv/tern_bin.mdwn +++ b/openpower/sv/tern_bin.mdwn @@ -13,9 +13,9 @@ Add this section to Book I 3.3.13 TLI-form -| 0-5 | 6-10 | 11-15 | 16-20 | 21-28 | 29-30 | 31 | Form | -|-----|------|-------|-------|-------|-------|----|----------| -| PO | RT | RA | RB | TLI | XO | Rc | TLI-Form | +TLI 0.5 | 6.10 | 11.15 | 16.20 | 21.28 | 29.30 | 31 | Form | +|-------|------|-------|-------|-------|-------|----|----------| +| PO | RT | RA | RB | TLI | XO | Rc | TLI-Form | * `ternlogi RT, RA, RB, TLI` (`Rc=0`) * `ternlogi. RT, RA, RB, TLI` (`Rc=1`) @@ -65,7 +65,7 @@ Special registers altered: \newpage{} -## Condition Register Ternary Logic Immediate +## Condition Register Field Ternary Logic Immediate Add this section to Book I 2.5.1 @@ -75,7 +75,7 @@ CRB-form |----|----|----|-----|-----|-----|-----|-----|---|----------| | PO | BF | msk|BFA | msk | BFB | TLI | XO |TLI| CRB-Form | -* `crternlogi BF, BFA, BFB, TLI, msk` +* `crfternlogi BF, BFA, BFB, TLI, msk` Pseudocode: @@ -134,6 +134,35 @@ Special registers altered: \newpage{} +## Condition Register Ternary Logic Immediate + +Add this section to Book I 2.5.1 + +TLI-form + +TLI 0.5 | 6.10 | 11.15 | 16.20 | 21.28 | 29.31 | Form | +|-------|------|-------|-------|-------|-------|----------| +| PO | BT | BA | BB | TLI | XO | TLI-Form | + +* `crternlogi BT, BA, BB, TLI` + +Pseudocode: + +``` + idx <- CR[BT+32] || CR[BA+32] || CR[BB+32] + CR[4*BT+32] <- TLI[7-idx] +``` + +Special registers altered: + +``` + CR[BT+32] +``` + +---------- + +\newpage{} + ## GPR Dynamic Binary Logic Add this section to Book I 3.3.13 @@ -208,7 +237,7 @@ CRB-form |----|----|----|-----|-----|-----|-----|-----|---|----------| | PO | BF | msk|BFA | msk | BFB | // | XO |// | CRB-Form | -* `crbinlog BF, BFA, BFB, msk` +* `crfbinlog BF, BFA, BFB, msk` Pseudocode: @@ -260,6 +289,37 @@ A simple copy instruction may be used to achieve the effect of 3-in 1-out. The copy instruction should come immediately before `crternlogi` so that hardware may optionally Macro-Op Fuse them* +## Condition Register Dynamic Binary Logic + +Add this section to Book I 2.5.1 + +X-form + +| 0.5|6.10|11.15|16.20|21.30| 31| Form | +|----|----|-----|-----|-----|---|----------| +| PO | BT | BA | BB | XO | / | CRB-Form | + +* `crbinlog BF, BFA, BFB, msk` + +Pseudocode: + +``` + lut <- CR[4*BFB+32:4*BFB+35] + idx <- CR[BT+32] || CR[BA+32] + CR[BT+32] <- lut[3-idx] +``` + +Special registers altered: + +``` + CR[BT+32] +``` + +*Programmer's Note: just as with binlut and ternlogi, a pair + of crbinlog instructions followed by a merging crternlogi may + be deployed to synthesise dynamic ternary (LUT3) CR Field + manipulation* + [[!tag standards]] ---------- -- 2.30.2