TestOp

usse_test.sail

the operation of an ALU (alu_sel: 0 the vector floats, 1 the integers, 2 the bytes, 3 the bitwise ones) and its op

function TestOp(sel : int, op : int) -> int =
    if sel == 0 then match op { 2 => TO_ADD, 3 => TO_FRC, 4 => TO_RCP, 5 => TO_RSQ, 6 => TO_LOG, 7 => TO_EXP,
                                8 => TO_DP, 9 => TO_MIN, 10 => TO_MAX, 11 => TO_DSX, 12 => TO_DSY, 13 => TO_MUL,
                                14 => TO_SUB, _ => TO_INVALID }
    else if sel == 1 then {
        if op < 6 then TO_INVALID else if op == 6 | op == 9 | op == 12 | op == 13 then TO_IADD
        else if op == 7 | op == 10 | op == 14 | op == 15 then TO_ISUB else TO_IMUL
    } else if sel == 2 then match op { 0 => TO_IADD, 1 => TO_ISUB, 2 => TO_IADD, 3 => TO_ISUB, 4 => TO_IMUL,
                                       6 => TO_IMUL, 8 => TO_ISUB, _ => TO_INVALID }
    else match op { 0 => TO_AND, 1 => TO_OR, 2 => TO_XOR, 3 => TO_SHL, 4 => TO_SHR, 5 => TO_ROL, 7 => TO_ASR,
                    _ => TO_INVALID }

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).