VMOV

Moves

fixed bit field field the encoding fixes should be

Encoding

6362616059585756555453525150494847464544434241403938373635343332
00111predskipinvtest2comp_selsyncstartdest_extsrc0_extsrc1_extsrc2_extmove_typerepeat_countnoscheddata_typetest1src0_swizsrc0_bankdest_bank
313029282726252423222120191817161514131211109876543210
src1_banksrc2_bankmaskdest_nsrc0_nsrc1_nsrc2_n

bits 63:0: 0011 1xxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx

Runs execute_VMOV with Form() 0.

Fields

FieldBitsThe Sail reads it in
pred58:56
skipinv55
test254Bit(54)
comp_sel53Bit(53)
syncstart52
dest_ext51Bit(51)
src0_ext50Bit(50)
src1_ext49Bit(49)
src2_ext48Bit(48)
move_type47:46execute_VMOV
repeat_count45:44execute_VMOV
nosched43
data_type42:40execute_VMOV
test139Bit(39)
src0_swiz38:35execute_VMOV
src0_bank34Bit(34)
dest_bank33:32execute_VMOV
src1_bank31:30execute_VMOV
src2_bank29:28execute_VMOV
mask27:24execute_VMOV
dest_n23:18execute_VMOV
src0_n17:12execute_VMOV
src1_n11:6execute_VMOV
src2_n5:0execute_VMOV

Operation Sail

VMOV: src1's components the mask enables into the destination; with a move type, each where the test of src0's same component against zero holds (test1 and test2), else src2's. A repeat at a time

let move_type = UInt(Field(46, 2));
let type = UInt(Field(40, 3));
if move_type == 3 then throw(Refuse("VMOV move type 3"));
let doubled = type == T_C10 | type == T_F16 | type == T_F32;
let conditional = move_type != 0;
let bits = if doubled then 7 else 6;
Dest(DEST, UInt(Field(18, 6)), UInt(Field(32, 2)), Bit(51), doubled, bits);
Src12(SRC1, UInt(Field(6, 6)), UInt(Field(30, 2)), Bit(49), doubled, bits);
let mask = if type == T_F16 | type == T_F32 then WriteMask(DEST, UInt(Field(24, 4)), type == T_F16)
           else if not_bool(doubled) then 1 else UInt(Field(24, 4));
if doubled then Vec34Swizzle(SRC1, UInt(Field(35, 4)), 0, 2) else SetSwizzle(SRC1, SW_X, SW_Y, SW_Z, SW_W);
SetType(SRC1, type);
SetType(DEST, type);
let test_type = if move_type == 2 then T_U8 else type;
let compare = Bit(54) * 2 + Bit(39);
if conditional then {
    Src0(SRC0, UInt(Field(12, 6)), Bit(34), Bit(50), doubled, bits);
    SetType(SRC0, test_type);
    Src12(SRC2, UInt(Field(0, 6)), UInt(Field(28, 2)), Bit(48), doubled, bits);
    SetType(SRC2, type);
    if Bit(53) == 1 then CopySwizzle(SRC0, SRC1);
    CopySwizzle(SRC2, SRC1)
};
if doubled & (type == T_F16 | type == T_F32) then Multiplier(2, 2, 2, 2) else Multiplier(1, 1, 1, 1);
foreach (r from 0 to UInt(Field(44, 2))) {
    if not_bool(Failed()) then {
        Load(A, SRC1, mask, Rep(SRC1, r, O_SRC1, R_SLMSI));
        CopyValue(R, A);
        if conditional then {
            Load(TEST, SRC0, mask, Rep(SRC0, r, O_SRC0, R_SLMSI));
            Load(B, SRC2, mask, Rep(SRC2, r, O_SRC2, R_SLMSI));
            let kind = KindOf(TEST);
            foreach (i from 0 to Min(Count(A), Count(TEST)) - 1) {
                let zero = ZeroOf(kind);
                let cond = MoveTest(kind, compare, At(TEST, i), zero);
                let a = At(A, i);
                let b = At(B, i);
                Put(R, i, if cond then a else b)
            }
        };
        Store(DEST, R, mask, Rep(DEST, r, O_DEST, R_SLMSI))
    }
};
ResetMultiplier()

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