HFMA2.MMA

Floating point

fixed bit field field the encoding fixes should be

Encoding

12712612512412312212112011911811711611511411311211111010910810710610510410310210110099989796
reusewaitrd_barwr_baryieldstall
9594939291908988878685848382818079787776757473727170696867666564
[91:73]
6362616059585756555453525150494847464544434241403938373635343332
313029282726252423222120191817161514131211109876543210
RaRdpred.notpred0xx000110101
form

bits 15:0: ---- 0010 0011 0101
bits 15:0: ---- 0100 0011 0101

Forms

Form (bits 11:9)bc
1 (001)Rb at 32Rc at 64
2 (010)Rb at 64immediate at 32

HFMA2.MMA (0x035), HFMA2 on the MMA pipe: CuAssembler's sm_86 records give forms 1 and 2 with HFMA2's fields, "HFMA2.MMA R24, R12, R17, R24" and "HFMA2.MMA R4, -RZ, RZ, 0, 0"

Runs execute_HFMA2_MMA.

Fields

FieldBitsFrom
reuse125:122the decoder
wait121:116the decoder
rd_bar115:113the decoder
wr_bar112:110the decoder
yield109the decoder
stall108:105the decoder
[91:73]91:73execute_HFMA2_MMA
Ra31:24the decoder
Rd23:16the decoder
pred.not15the decoder
pred14:12the decoder
form11:9the decoder

Operation Sail

HFMA2.MMA: only a product of RZ. It is a signed zero (the sign of a's and b's negations), and the sum with the two halves of c, in floats, is exact. ptxas loads two halves with HFMA2.MMA R, -RZ, RZ, imm, imm. Other modifiers (73-91 but b's negation at 75) are refused

let zero = IsRegZero(A) | IsRegZero(B);
if not_bool(zero) | (Field(73, 19) & not_vec(0b0000000000000000100)) != 0b0000000000000000000 then
    throw(Unsupported("HFMA2.MMA of a product other than RZ, or with modifiers 0x%x", Field(73, 19)));
let sign = if SrcNegRaw(A) != SrcNegRaw(B) then 0x80000000 else 0x00000000;
let p = Half2(Float32(sign), Float32(sign));
let c0 = UnpackHalf2(SrcBits(C));
let c1 = if SrcIsReg(C) & SrcAbsRaw(C) then Half2Abs(c0) else c0;
let c2 = if SrcIsReg(C) & SrcNegRaw(C) then Half2Neg(c1) else c1;
D_write(PackHalf(NoContract2(Half2Add(p, c2))))

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.