From: Luke Kenneth Casson Leighton Date: Mon, 20 Mar 2023 13:53:44 +0000 (+0000) Subject: move sections around (to correct location) in ls007 X-Git-Tag: opf_rfc_ls001_v3~134 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8136ed4263b6eb87da1eaedc3168195b65edc023;p=libreriscv.git move sections around (to correct location) in ls007 update wording on crbinlut --- diff --git a/openpower/sv/rfc/ls007.mdwn b/openpower/sv/rfc/ls007.mdwn index 3f6a4129c..8614e7cf2 100644 --- a/openpower/sv/rfc/ls007.mdwn +++ b/openpower/sv/rfc/ls007.mdwn @@ -30,10 +30,10 @@ Instructions added -* `ternlogi` -- Ternary Logic Immediate -* `crternlogi` -- Condition Register Ternary Logic Immediate -* `binlog` -- Dynamic Binary Logic -* `crbinlog` -- Condition Register Dynamic Binary Logic +* `ternlogi` -- GPR Ternary Logic Immediate +* `crternlogi` -- Condition Register Field Ternary Logic Immediate +* `binlog` -- GPR Dynamic Binary Logic +* `crbinlog` -- Condition Register Field Dynamic Binary Logic **Submitter**: Luke Leighton (Libre-SOC) @@ -93,75 +93,7 @@ Add the following entries to: \newpage{} -# CRB-FORM - -Add the following section to Book I 1.6.1 - -``` -|0 |6 |9 |12 |15 |18 |21 |29 |31 | -| PO | BF | BFA | BFB | BFC | msk | TLI | XO | msk | -``` - -# TLI-FORM - -Add the following section to Book I 1.6.1 - -``` -|0 |6 |11 |16 |21 |29 |31 | -| PO | RT | RA | RB | TLI | XO | Rc | -``` - -# VA-FORM - -Add the following entry to VA-FORM in Book I 1.6.1.12 - -``` -|0 |6 |11 |16 |21|22 |26|27 | -| PO | RT | RA | RB | RC |nh| XO | -``` - -# Word Instruction Fields - -Add the following to Book I 1.6.2 - -``` -msk (9:10,14:15) - Field used by crternlogi to decide which CR bits to modify. - Formats: CRB - -nh (26) - Nibble High. Field used by binlog to decide if the look-up-table should - be taken from bits 60:63 or 56:59 of RC. - Formats: VA - -TLI (21:28) - Field used by the ternlogi instruction as the - look-up table. - Formats: TLI -TLI (21:25,19:20,31) - Field used by the crternlogi instruction as the - look-up table. - Formats: CRB - -XO (29:30) - Extended opcode field. - Formats: TLI -XO (26:30) - Extended opcode field. - Formats: CRB -``` - -* Add `TLI` to the `Formats:` list of all of `RA`, `RB`, `RT`, and `Rc`. -* Add `CRB` to the `Formats:` list of all of `BF`, `BFA`, `BFB`, and `BFC`. -* Add `TLI` to the `Formats:` list of `XO (29:30)`. -* Add `CRB` to the `Formats:` list of `XO (26:31)`. -* Add `VA` to the `Formats:` list of `XO (27:31)`. - ----------- - -\newpage{} - -# Ternary Logic Immediate +# GPR Ternary Logic Immediate Add this section to Book I 3.3.13 @@ -198,7 +130,7 @@ For each integer value i, 0 to 63, do the following. Functions," on page 968 for the equivalent function evaluated by this instruction for any given value of TLI. -Programmer's Note: this is a Read-Modify-Write instruction on RT. +*Programmer's Note: this is a Read-Modify-Write instruction on RT.* Special registers altered: @@ -267,12 +199,12 @@ CR field BF \newpage{} -# Dynamic Binary Logic - -VA-form +# GPR Dynamic Binary Logic Add this section to Book I 3.3.13 +VA-form + * `binlog RT, RA, RB, RC, nh` | 0-5 | 6-10 | 11-15 | 16-20 | 21-25 | 26 | 27-31 | Form | @@ -310,9 +242,10 @@ None **Programmer's Note**: -Dynamic Ternary Logic may be emulated by appropriate combination of -`binlog` and `ternlogi`, using the `nh` (next half) operand to select -first and second nibble: +Dynamic (non-immediate-based) Ternary Logic, suitable for FPGA-style LUT3 +dynamic lookups and for JIT runtime acceleration, may be emulated by +appropriate combination of `binlog` and `ternlogi`, using the `nh` +(next half) operand to select first and second nibble: ``` # compute r3 = ternlog(r4, r5, r6, table=r7) @@ -328,10 +261,11 @@ ternlogi r3, r4, r6, 0b11011000 \newpage{} -## crbinlog +# Condition Register Field Dynamic Binary Logic + +Add this section to Book I 2.5.1 -With ternary (LUT3) dynamic instructions being very costly, -and CR Fields being only 4 bit, a binary (LUT2) variant is better +CRB-form | 0.5|6.8 |9.10|11.13|14.15|16.18|19.25|26.30| 31| Form | |----|----|----|-----|-----|-----|-----|-----|---|----------| @@ -361,17 +295,95 @@ For each integer value i, 0 to 3, do the following. Otherwise, if bit i of msk is a zero then bit i of CR Field BF is unchanged. -*Programmer's note: just as with binlut and ternlogi, a pair +Special registers altered: + +``` +CR field BF +``` + +*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* +*Programmer's Note: this instruction is a "masked" overwrite on CR +Field BF. For each bit set in `msk` a Write is performed +but for each bit clear in `msk` the corresponding bit of BF is +preserved. Overall this makes `crbinlog` a conditionally +Read-Modify-Write instruction on CR Field BF* + ---------- \newpage{} +# CRB-FORM + +Add the following section to Book I 1.6.1 + +``` +|0 |6 |9 |12 |15 |18 |21 |29 |31 | +| PO | BF | BFA | BFB | BFC | msk | TLI | XO | msk | +``` + +# TLI-FORM + +Add the following section to Book I 1.6.1 + +``` +|0 |6 |11 |16 |21 |29 |31 | +| PO | RT | RA | RB | TLI | XO | Rc | +``` + +# VA-FORM + +Add the following entry to VA-FORM in Book I 1.6.1.12 + +``` +|0 |6 |11 |16 |21|22 |26|27 | +| PO | RT | RA | RB | RC |nh| XO | +``` + +# Word Instruction Fields + +Add the following to Book I 1.6.2 + +``` +msk (9:10,14:15) + Field used by crternlogi to decide which CR bits to modify. + Formats: CRB + +nh (26) + Nibble High. Field used by binlog to decide if the look-up-table should + be taken from bits 60:63 or 56:59 of RC. + Formats: VA + +TLI (21:28) + Field used by the ternlogi instruction as the + look-up table. + Formats: TLI +TLI (21:25,19:20,31) + Field used by the crternlogi instruction as the + look-up table. + Formats: CRB + +XO (29:30) + Extended opcode field. + Formats: TLI +XO (26:30) + Extended opcode field. + Formats: CRB +``` + +* Add `TLI` to the `Formats:` list of all of `RA`, `RB`, `RT`, and `Rc`. +* Add `CRB` to the `Formats:` list of all of `BF`, `BFA`, `BFB`, and `BFC`. +* Add `TLI` to the `Formats:` list of `XO (29:30)`. +* Add `CRB` to the `Formats:` list of `XO (26:31)`. +* Add `VA` to the `Formats:` list of `XO (27:31)`. + ---------- +\newpage{} + # Appendices Appendix E Power ISA sorted by opcode