HalfPair

sm86.sail

a 16-bit ALU operand as a pair: its swizzle (1, a float, refused), then its abs and neg

function HalfPair(s : Operand, sw : int, absed : bool, neg : bool, what : string) -> half2 = {
    if sw == 1 then throw(Unsupported("%s with a float operand", what));
    let pair = UnpackHalf2(SrcBits(s));
    let swizzled = if sw >= 2 then {
        let h = Half2At(pair, sw - 2);
        Half2(h, h)
    } else pair;
    let a = if absed then Half2Abs(swizzled) else swizzled;
    if neg then Half2Neg(a) else a
}

Used by


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.