Vmad2Swizzle

usse_float.sail

VMAD2's swizzles of src0, src1 and src2 (a channel code: XYZW is 0x0123, 291)

function Vmad2Swizzle(which : int, s : int) -> int =
    if s <= 3 then 4369 * s /* XXXX, YYYY, ZZZZ, WWWW */ else if s == 4 then 291 /* XYZW */
    else if which == 0 then { if s == 5 then 4611 /* YZXW */ else if s == 6 then 307 /* XYWW */ else 8961 /* ZWXY */ }
    else if which == 1 then { if s == 5 then 274 /* XYYZ */ else if s == 6 then 4403 /* YYWW */ else 12579 /* WYZW */ }
    else { if s == 5 then 563 /* XZWW */ else if s == 6 then 18 /* XXYZ */ else 290 /* XYZZ */ }

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 Vita3K's usse_translator_entry.cpp (GPL-2.0-or-later).