HFMA2: a * b + c by halves. a as HADD2's. The operand in the register at 64 keeps its swizzle at 81-82 and its modifiers at 83 (abs) and 84 (neg), not where a three-source float's are. Bit 79 is .RELU: a result at or below zero becomes zero where the predicate at 87 holds, while infinity and NaN stay. Bit 86 is .H0_NH1: b's halves swap and the new low one is negated, the second term of a complex product. Bits 78 and 85 are refused. A product of two halves is exact in a float of 32 bits, and its sum with c is rounded once (sum_to_odd), as the console's fused multiply-add of halves is
function Hfma2Operand(k : int, s : Operand, b_at_64 : bool, h0_nh1 : bool) -> half2 = {
let at_64 = k != 0 & ((k == 1) == b_at_64);
let imm = SrcIsImm(s);
let sw = if imm then 0 else if k == 0 then UInt(Field(74, 2)) else if at_64 then UInt(Field(81, 2)) else UInt(Field(60, 2));
let absed = if imm then false else if at_64 then Field(83, 1) == 0b1 else SrcAbsRaw(s);
let neg = if imm then false else if at_64 then Field(84, 1) == 0b1 else SrcNegRaw(s);
if sw == 1 then throw(Unsupported("HFMA2 with a float operand"));
if k == 1 & h0_nh1 & (sw != 0 | absed) then throw(Unsupported("HFMA2.H0_NH1 of an operand with a swizzle or abs"));
let pair = UnpackHalf2(SrcBits(s));
let swizzled = if sw >= 2 then {
let h = Half2At(pair, sw - 2);
Half2(h, h)
} else pair;
let swapped = if k == 1 & h0_nh1 then {
let low = Half2At(swizzled, 0);
let high = Half2At(swizzled, 1);
Half2(FNeg(high), low)
} else swizzled;
let a = if absed then Half2Abs(swapped) else swapped;
if neg then Half2Neg(a) else a
}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.