fixed bit field field the encoding fixes should be
| 127 | 126 | 125 | 124 | 123 | 122 | 121 | 120 | 119 | 118 | 117 | 116 | 115 | 114 | 113 | 112 | 111 | 110 | 109 | 108 | 107 | 106 | 105 | 104 | 103 | 102 | 101 | 100 | 99 | 98 | 97 | 96 |
| reuse | wait | rd_bar | wr_bar | yield | stall | ||||||||||||||||||||||||||
| 95 | 94 | 93 | 92 | 91 | 90 | 89 | 88 | 87 | 86 | 85 | 84 | 83 | 82 | 81 | 80 | 79 | 78 | 77 | 76 | 75 | 74 | 73 | 72 | 71 | 70 | 69 | 68 | 67 | 66 | 65 | 64 |
| CarryIn(87) | CarryIn(87) | q | p | CarryIn(77) | CarryIn(77) | x | |||||||||||||||||||||||||
| 63 | 62 | 61 | 60 | 59 | 58 | 57 | 56 | 55 | 54 | 53 | 52 | 51 | 50 | 49 | 48 | 47 | 46 | 45 | 44 | 43 | 42 | 41 | 40 | 39 | 38 | 37 | 36 | 35 | 34 | 33 | 32 |
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| URa | URd | pred.not | pred | form | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | ||||||||||||||||||
bits 15:0: ---- 0010 1001 0000
bits 15:0: ---- 0100 1001 0000
bits 15:0: ---- 1000 1001 0000
| Form (bits 11:9) | b | c |
|---|---|---|
| 1 (001) | URb at 32 | URc at 64 |
| 2 (010) | URb at 64 | immediate at 32 |
| 4 (100) | immediate at 32 | URc at 64 |
Runs execute_IADD3.
| Field | Bits | From |
|---|---|---|
| reuse | 125:122 | the decoder |
| wait | 121:116 | the decoder |
| rd_bar | 115:113 | the decoder |
| wr_bar | 112:110 | the decoder |
| yield | 109 | the decoder |
| stall | 108:105 | the decoder |
| CarryIn(87) | 90 | CarryIn(87) |
| CarryIn(87) | 89:87 | CarryIn(87) |
| q | 86:84 | execute_IADD3 |
| p | 83:81 | execute_IADD3 |
| CarryIn(77) | 80 | CarryIn(77) |
| CarryIn(77) | 79:77 | CarryIn(77) |
| x | 74 | execute_IADD3 |
| URa | 29:24 | the decoder |
| URd | 21:16 | the decoder |
| pred.not | 15 | the decoder |
| pred | 14:12 | the decoder |
| form | 11:9 | the decoder |
IADD3 and UIADD3: a + b + c, with the carries out in the predicates p (81) and q (84) and, for .X (74), two carries in (87 and 77)
let p = UInt(Field(81, 3));
let q = UInt(Field(84, 3));
let x = Field(74, 1) == 0b1;
if p >= PT & q >= PT & not_bool(x) then {
/* the sum of the terms that aren't zero, a register's or an immediate's whatever the state */
var sum : bits(32) = 0x00000000;
var any : bool = false;
if not_bool(IsZero(A)) then {
sum = SrcInt(A);
any = true
};
if not_bool(IsZero(B)) then {
if any then { sum = sum + SrcInt(B) } else { sum = SrcInt(B) };
any = true
};
if not_bool(IsZero(C)) then { if any then { sum = sum + SrcInt(C) } else { sum = SrcInt(C) } };
D_write(sum)
} else {
/* the sum in 64 bits: its carries, and .X's two carries in */
var sum : bits(64) = Term64(A, x) + Term64(B, x);
sum = sum + Term64(C, x);
if x then {
sum = sum + CarryIn(87);
sum = sum + CarryIn(77)
};
let high = sum[63 .. 32];
D_write(sum[31 .. 0]);
PredWrite(p, 0 < UInt(high), Uniform());
PredWrite(q, 1 < UInt(high), Uniform())
}
Made from ScarletNX's Sail at 166ad3910f80. The Sail and the encodings' file are ScarletNX's (GPL-3.0-or-later); its encodings are from Mesa's NAK (sm70_encode.rs, MIT) and CuAssembler's sm_86 records.