RRO

Floating point instructions

fixed bit field field the encoding fixes should be

RRO (reg)

6362616059585756555453525150494847464544434241403938373635343332
0101110010010
313029282726252423222120191817161514131211109876543210
Rbpred.notpredRaRd

bits 63:48: 0101 1100 1001 0---

Runs execute_MUFU with Form() 1.

RRO (cbuf)

6362616059585756555453525150494847464544434241403938373635343332
0100110010010
313029282726252423222120191817161514131211109876543210
pred.notpredRaRd

bits 63:48: 0100 1100 1001 0---

Runs execute_MUFU with Form() 2.

RRO (imm)

6362616059585756555453525150494847464544434241403938373635343332
001110010010
313029282726252423222120191817161514131211109876543210
pred.notpredRaRd

bits 63:48: 0011 100- 1001 0---

Runs execute_MUFU with Form() 3.

Fields

The operation reads some of these fields in some forms alone (it chooses by Form()), so the diagrams show only the decoder's.

FieldBitsFrom
[50]50execute_MUFU
absolute49execute_MUFU
value48execute_MUFU
value46execute_MUFU
negative45execute_MUFU
Rb27:20RegB()
fn23:20execute_MUFU
pred.not19the decoder
pred18:16the decoder
Ra15:8RegA()
Rd7:0Dst()

Operation Sail

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).