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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | |||||||||||||||||||
| 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: 0101 0000 1000 0---
Runs execute_MUFU with Form() 0.
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 |
|---|---|---|
| [50] | 50 | execute_MUFU |
| absolute | 49 | execute_MUFU |
| value | 48 | execute_MUFU |
| value | 46 | execute_MUFU |
| negative | 45 | execute_MUFU |
| fn | 23:20 | execute_MUFU |
| pred.not | 19 | the decoder |
| pred | 18:16 | the decoder |
| Ra | 15:8 | RegA() |
| Rd | 7:0 | Dst() |
MUFU (the function at 20-23 of a, its abs at 46 and neg at 48, .SAT at 50) and RRO (b's float, its abs at 49 and neg at 45, as it is: the range reduction the functions take is none here). RCP64H and RSQ64H (6, 7): a is a double's high word (the low one 0), the result the high word of its reciprocal or reciprocal square root, as Mesa's nouveau uses them
let f = Form(); /* 0 MUFU, 1-3 RRO R, C, I */
let fn = UInt(Field(20, 4));
if f == 0 & (fn == 6 | fn == 7) then {
let value = DoubleMod(DFromHigh(R_read(RegA())), UInt(Field(46, 1)), UInt(Field(48, 1)));
R_write(Dst(), DHigh(if fn == 6 then DRcp(value) else DInvSqrt(value)))
} else {
let value0 = if f == 2 then CbufF() else if f == 3 then Imm20F() else R_readF(if f == 0 then RegA() else RegB());
let absolute = if f == 0 then Field(46, 1) == 0b1 else Field(49, 1) == 0b1;
let negative = if f == 0 then Field(48, 1) == 0b1 else Field(45, 1) == 0b1;
let value1 = if absolute then FAbs(value0) else value0;
let value = if negative then FNeg(value1) else value1;
if f == 0 then {
let r = match fn { 0 => FCos(value), 1 => FSin(value), 2 => FExp2(value), 3 => FLog2(value),
5 => FInvSqrt(value), 8 => FSqrt(value), 4 => FDiv(FConst(0x3f800000), value), _ => value };
R_writeF(Dst(), FloatSaturate(r, UInt(Field(50, 1))))
} else R_writeF(Dst(), value)
}
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).