Pseudocode:
```
-result <- (~RT & ~RA & ~RB & TLI[0]*64) | # 64 copies of TLI[0]
- (~RT & ~RA & RB & TLI[1]*64) | # ...
- (~RT & RA & ~RB & TLI[2]*64) |
- (~RT & RA & RB & TLI[3]*64) |
- ( RT & ~RA & ~RB & TLI[4]*64) |
- ( RT & ~RA & RB & TLI[5]*64) |
- ( RT & RA & ~RB & TLI[6]*64) | # ...
- ( RT & RA & RB & TLI[7]*64) # 64 copies of TLI[7]
-RT <- result
+ result <- (~RT & ~RA & ~RB & TLI[0]*64) | # 64 copies of TLI[0]
+ (~RT & ~RA & RB & TLI[1]*64) | # ...
+ (~RT & RA & ~RB & TLI[2]*64) |
+ (~RT & RA & RB & TLI[3]*64) |
+ ( RT & ~RA & ~RB & TLI[4]*64) |
+ ( RT & ~RA & RB & TLI[5]*64) |
+ ( RT & RA & ~RB & TLI[6]*64) | # ...
+ ( RT & RA & RB & TLI[7]*64) # 64 copies of TLI[7]
+ RT <- result
```
For each integer value i, 0 to 63, do the following.
Special registers altered:
```
-CR0 (if Rc=1)
+ CR0 (if Rc=1)
```
----------
Pseudocode:
```
-a <- CR[4*BF+32:4*BF+35]
-b <- CR[4*BFA+32:4*BFA+35]
-c <- CR[4*BFB+32:4*BFB+35]
-ternary <- (~a & ~b & ~c & TLI[0]*4) | # 4 copies of TLI[0]
- (~a & ~b & c & TLI[1]*4) | # 4 copies of TLI[1]
- (~a & b & ~c & TLI[2]*4) | # ...
- (~a & b & c & TLI[3]*4) |
- ( a & ~b & ~c & TLI[4]*4) |
- ( a & ~b & c & TLI[5]*4) |
- ( a & b & ~c & TLI[6]*4) | # ...
- ( a & b & c & TLI[7]*4)) # 4 copies of TLI[7]
-do i = 0 to 3
- if msk[i] = 1 then
- CR[4*BF+32+i] <- ternary[i]
+ a <- CR[4*BF+32:4*BF+35]
+ b <- CR[4*BFA+32:4*BFA+35]
+ c <- CR[4*BFB+32:4*BFB+35]
+ ternary <- (~a & ~b & ~c & TLI[0]*4) | # 4 copies of TLI[0]
+ (~a & ~b & c & TLI[1]*4) | # 4 copies of TLI[1]
+ (~a & b & ~c & TLI[2]*4) | # ...
+ (~a & b & c & TLI[3]*4) |
+ ( a & ~b & ~c & TLI[4]*4) |
+ ( a & ~b & c & TLI[5]*4) |
+ ( a & b & ~c & TLI[6]*4) | # ...
+ ( a & b & c & TLI[7]*4)) # 4 copies of TLI[7]
+ do i = 0 to 3
+ if msk[i] = 1 then
+ CR[4*BF+32+i] <- ternary[i]
```
For each integer value i, 0 to 3, do the following.
Special registers altered:
```
-CR field BF
+ CR field BF
```
----------
Pseudocode:
```
-if nh = 1 then lut <- (RC)[56:59]
-else lut <- (RC)[60:63]
-result <- (~RA & ~RB & lut[0]*64) |
- (~RA & RB & lut[1]*64) |
- ( RA & ~RB & lut[2]*64) |
- ( RA & RB & lut[3]*64))
-RT <- result
+ if nh = 1 then lut <- (RC)[56:59]
+ else lut <- (RC)[60:63]
+ result <- (~RA & ~RB & lut[0]*64) |
+ (~RA & RB & lut[1]*64) |
+ ( RA & ~RB & lut[2]*64) |
+ ( RA & RB & lut[3]*64))
+ RT <- result
```
For each integer value i, 0 to 63, do the following.
Special registers altered:
```
-None
+ None
```
**Programmer's Note**:
(next half) operand to select first and second nibble:
```
-# compute r3 = ternlog(r4, r5, r6, table=r7)
-# compute the values for when r6[i] = 0:
-binlog r3, r4, r5, r7, 0 # takes look-up-table from LSB 4 bits
-# compute the values for when r6[i] = 1:
-binlog r4, r4, r5, r7, 1 # takes look-up-table from second-to-LSB 4 bits
-# mux the two results together: r3 = (r3 & ~r6) | (r4 & r6)
-ternlogi r3, r4, r6, 0b11011000
+ # compute r3 = ternlog(r4, r5, r6, table=r7)
+ # compute the values for when r6[i] = 0:
+ binlog r3, r4, r5, r7, 0 # takes look-up-table from LSB 4 bits
+ # compute the values for when r6[i] = 1:
+ binlog r4, r4, r5, r7, 1 # takes look-up-table from second-to-LSB 4 bits
+ # mux the two results together: r3 = (r3 & ~r6) | (r4 & r6)
+ ternlogi r3, r4, r6, 0b11011000
```
----------
| PO | BF | msk|BFA | msk | BFB | // | XO |// | CRB-Form |
```
-a <- CR[4*BF+32:4*BFA+35]
-b <- CR[4*BFA+32:4*BFA+35]
-lut <- CR[4*BFB+32:4*BFB+35]
-binary <- (~a & ~b & lut[0]*4) |
- (~a & b & lut[1]*4) |
- ( a & ~b & lut[2]*4) |
- ( a & b & lut[3]*4))
-do i = 0 to 3
- if msk[i] = 1 then
- CR[4*BF+32+i] <- binary[i]
+ a <- CR[4*BF+32:4*BFA+35]
+ b <- CR[4*BFA+32:4*BFA+35]
+ lut <- CR[4*BFB+32:4*BFB+35]
+ binary <- (~a & ~b & lut[0]*4) |
+ (~a & b & lut[1]*4) |
+ ( a & ~b & lut[2]*4) |
+ ( a & b & lut[3]*4))
+ do i = 0 to 3
+ if msk[i] = 1 then
+ CR[4*BF+32+i] <- binary[i]
```
For each integer value i, 0 to 3, do the following.
Special registers altered:
```
-CR field BF
+ CR field BF
```
*Programmer's Note: just as with binlut and ternlogi, a pair
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 |
+ |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 |
+ |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 |
+ |0 |6 |11 |16 |21 |26|27 |
+ | PO | RT | RA | RB | RC |nh| XO |
```
# Word Instruction Fields