FADD, FMUL and FFMA: bit 77 saturate, 78-79 the rounding mode, 80 FTZ, and FMUL's 84-86 the scale 2^(field - 4), which nvdisasm names .D4 (2), .D2 (3) and none (4). An FMUL fmul_over_w takes is its value
function FArith(op : FOp) -> unit = {
let on = UInt(Field(80, 1));
let mode = UInt(Field(78, 2));
let scale = UInt(Field(84, 3));
NoteFtz(on);
let attr = match op { OpFMUL => FmulOverW(), _ => 0 };
let v : bits(32) = if attr != 0 then ValueF(attr) else {
let x = Ftz(SrcF(A), on);
match op {
OpFADD => FloatAdd(mode, x, Ftz(SrcF(Second), on)),
OpFMUL => {
if scale == 0 then throw(Unsupported("FMUL with scale field 0"));
FloatMul(mode, scale, x, Ftz(SrcF(B), on))
},
_ => {
let y = Ftz(SrcF(B), on);
FloatFma(mode, x, y, Ftz(SrcF(C), on))
}
}
};
D_write(Bits32(Saturate(Ftz(v, on), UInt(Field(77, 1)))))
}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.