MUFU

Floating point

fixed bit field field the encoding fixes should be

Encoding

12712612512412312212112011911811711611511411311211111010910810710610510410310210110099989796
reusewaitrd_barwr_baryieldstall
9594939291908988878685848382818079787776757473727170696867666564
fnhalf
6362616059585756555453525150494847464544434241403938373635343332
[61]x
313029282726252423222120191817161514131211109876543210
RaRdpred.notpredform100001000

bits 15:0: ---- 0011 0000 1000
bits 15:0: ---- 1001 0000 1000
bits 15:0: ---- 1011 0000 1000
bits 15:0: ---- 1101 0000 1000

Forms

Form (bits 11:9)bc
1 (001)Rb at 32Rc at 64
4 (100)immediate at 32Rc at 64
5 (101)constant buffer: offset at 38, bank at 54Rc at 64
6 (110)URb at 32Rc at 64

Runs execute_MUFU.

Fields

FieldBitsFrom
reuse125:122the decoder
wait121:116the decoder
rd_bar115:113the decoder
wr_bar112:110the decoder
yield109the decoder
stall108:105the decoder
fn79:74execute_MUFU
half73execute_MUFU
[61]61execute_MUFU
x60HalfOf
Ra31:24the decoder
Rd23:16the decoder
pred.not15the decoder
pred14:12the decoder
form11:9the decoder

Operation Sail

MUFU: the function at 74-79 of b. .F16 (bit 73): the operand is the half bit 60 names, with b's modifiers, and the result the low half

let half = Field(73, 1) == 0b1;
let fn = UInt(Field(74, 6));
if half & Field(61, 1) == 0b1 then throw(Unsupported("MUFU.F16 with a swizzle"));
let x = if half then HalfOf(B) else SrcF(B);
let v : bits(32) = match fn {
    0 => FCos(FMul(x, FConst(0x40c90fdb))), /* the argument in turns, as the hardware takes it */
    1 => FSin(FMul(x, FConst(0x40c90fdb))),
    2 => FExp2(x),
    3 => FLog2(x),
    4 => FDiv(FConst(0x3f800000), x),
    5 => FInvSqrt(x),
    8 => FSqrt(x),
    9 => FTanh(x),
    _ => throw(Unsupported("MUFU function %u", fn))
};
if half then D_write(PackHalf(Half2(v, FConst(0x00000000)))) else D_write(Bits32(v))

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.