fixed bit field field the encoding fixes should be
| 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 |
| 0 | 0 | 0 | 0 | 1 | 1 | ||||||||||||||||||||||||||
| 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 |
| pred.not | pred | Ra | Rd | ||||||||||||||||||||||||||||
bits 63:48: 0000 11-- ---- ----
Runs execute_FFMA with Form() 4.
The operation reads some of these fields in some forms alone (it chooses by Form()), so the diagrams show only the decoder's.
| Field | Bits | From |
|---|---|---|
| addend | 57 | execute_FFMA |
| left | 56 | execute_FFMA |
| [55] | 55 | execute_FFMA |
| result | 54:53 | execute_FFMA |
| soft_ftz | 53 | execute_FFMA |
| [50] | 50 | execute_FFMA |
| addend | 49 | execute_FFMA |
| right | 48 | execute_FFMA |
| [46:39] | 46:39 | execute_FFMA |
| pred.not | 19 | the decoder |
| pred | 18:16 | the decoder |
| Ra | 15:8 | RegA() |
| Rd | 7:0 | Dst() |
FFMA and FFMA32I: a * b + c rounded once (an Fma without NoContraction may be split into a multiply and an add), b's and c's negations (FFMA32I: a's and c's), FTZ and FMZ at 53-54 (FMZ: a zero factor gives c), .SAT
let f = Form(); /* 0 R, 1 RC, 2 CR, 3 I, 4 32I */
let left0 = RegF(RegA());
let right0 = if f == 4 then Imm32F() else if f == 2 then CbufF() else if f == 3 then Imm20F()
else RegF(if f == 1 then UInt(Field(39, 8)) else RegB());
let addend0 = if f == 1 then CbufF() else RegF(if f == 4 then Dst() else UInt(Field(39, 8)));
let left = if f == 4 then FloatMod(left0, 0, UInt(Field(56, 1))) else left0;
let right = if f == 4 then right0 else FloatMod(right0, 0, UInt(Field(48, 1)));
let addend = if f == 4 then FloatMod(addend0, 0, UInt(Field(57, 1))) else FloatMod(addend0, 0, UInt(Field(49, 1)));
let soft_ftz = Field(53, 1) == 0b1 & SoftFtz();
let l = if soft_ftz then FloatFtz(left) else left;
let r = if soft_ftz then FloatFtz(right) else right;
let s = if soft_ftz then FloatFtz(addend) else addend;
let fma = FmaNC(l, r, s);
let flushed = if soft_ftz then FloatFtz(fma) else fma;
let result = if Field(53, 2) == 0b10 then {
let zero = FConst(0x00000000);
let left_zero = FCompare(2, l, zero);
let right_zero = FCompare(2, r, zero);
if left_zero | right_zero then s else flushed
} else flushed;
R_writeF(Dst(), FloatSaturate(result, if f == 4 then UInt(Field(55, 1)) else UInt(Field(50, 1))))
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 Eden's maxwell.inc (GPL-2.0-or-later).