VCOMP

Vector float instructions

fixed bit field field the encoding fixes should be

Encoding

6362616059585756555453525150494847464544434241403938373635343332
00110predskipinvdest_typesyncstartdest_extendsrc1_extrepeat_countnoschedopsrc_typesrc1_modsrc_compdest_bank
313029282726252423222120191817161514131211109876543210
src1_bankdest_nsrc1_nmask

bits 63:0: 0011 0xxx xxxx xxx- xxxx xxxx xxxx x-xx xx-- xxxx xxx- ---- --xx xxxx x--- xxxx

Runs execute_VCOMP with Form() 0.

Fields

FieldBitsThe Sail reads it in
pred58:56
skipinv55
dest_type54:53execute_VCOMP
syncstart52
dest_ext51Bit(51)
end50
src1_ext49Bit(49)
repeat_count47:44execute_VCOMP
nosched43
op42:41execute_VCOMP
src_type40:39execute_VCOMP
src1_mod38:37execute_VCOMP
src_comp36:35execute_VCOMP
dest_bank33:32execute_VCOMP
src1_bank31:30execute_VCOMP
dest_n27:21execute_VCOMP
src1_n13:7execute_VCOMP
mask3:0execute_VCOMP

Operation Sail

let dest_type = VcompType(UInt(Field(53, 2)));
let src_type = VcompType(UInt(Field(39, 2)));
if dest_type == T_UNK | src_type == T_UNK then throw(Refuse("VCOMP with type 3"));
let op = UInt(Field(41, 2));
Dest(DEST, UInt(Field(21, 7)), UInt(Field(32, 2)), Bit(51), 1, 8);
Src12(SRC1, UInt(Field(7, 7)), UInt(Field(30, 2)), Bit(49), 1, 8);
SetFlags(SRC1, Modifier(UInt(Field(37, 2))));
SetType(SRC1, src_type);
SetType(DEST, dest_type);
foreach (r from 0 to UInt(Field(44, 4))) {
    if not_bool(Failed()) then {
        Load(A, SRC1, 2 ^ UInt(Field(35, 2)), Rep(SRC1, r, O_SRC1, R_SLMSI));
        if not_bool(Failed()) then {
            let x = At(A, 0);
            Reset(R, 1, K_FLOAT);
            if op == 0 then Put(R, 0, FDiv(One(), x))
            else if op == 1 then Put(R, 0, FInvSqrt(x))
            else if op == 2 then Put(R, 0, FLog2(x))
            else {
                let nan = FIsNaN(x);
                let one = One();
                let e = FExp2(x);
                Put(R, 0, if nan then one else e)
            };
            Store(DEST, R, UInt(Field(0, 4)), Rep(DEST, r, O_DEST, R_SLMSI))
        }
    }
}

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