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)
\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
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:
\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 |
**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)
\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 |
|----|----|----|-----|-----|-----|-----|-----|---|----------|
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