VMAD

Vector float instructions

fixed bit field field the encoding fixes should be

Encoding

6362616059585756555453525150494847464544434241403938373635343332
00011predskipinvgpi1_swiz_ext1opcode2dest_extendsrc1_extrepeat_modegpi0_absrepeat_countnoschedmasksrc1_negsrc1_absgpi1_neggpi1_absgpi0_swiz_extdest_bank
313029282726252423222120191817161514131211109876543210
src1_bankgpi0_ndest_ngpi0_swizgpi1_swizgpi1_ngpi0_negsrc1_swiz_extsrc1_swizsrc1_n

bits 63:0: 0001 1xxx xx1x xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx

Runs execute_VMAD with Form() 0.

Fields

FieldBitsThe Sail reads it in
pred58:56
skipinv55
gpi1_swiz_ext54Bit(54)
opcode252Bit(52)
dest_ext51Bit(51)
end50
src1_ext49Bit(49)
repeat_mode48:47execute_VMAD
gpi0_abs46Bit(46)
repeat_count45:44execute_VMAD
nosched43
mask42:39execute_VMAD
src1_neg38Bit(38)
src1_abs37Bit(37)
gpi1_neg36Bit(36)
gpi1_abs35Bit(35)
gpi0_swiz_ext34Bit(34)
dest_bank33:32execute_VMAD
src1_bank31:30execute_VMAD
gpi0_n29:28execute_VMAD
dest_n27:22execute_VMAD
gpi0_swiz21:18execute_VMAD
gpi1_swiz17:14execute_VMAD
gpi1_n13:12execute_VMAD
gpi0_neg11Bit(11)
src1_swiz_ext10Bit(10)
src1_swiz9:6execute_VMAD
src1_n5:0execute_VMAD

Operation Sail

VMAD: the GPI register gpi0 times src1 plus gpi1, of three components (vec4: four), each source swizzled and its modifiers applied; repeat_count repeats of repeat_mode

let type = if Bit(52) == 1 then 2 else 1;
let mode = UInt(Field(47, 2));
let mask = UInt(Field(39, 4));
Src12(SRC1, UInt(Field(0, 6)), UInt(Field(30, 2)), Bit(49), 1, 7);
Dest(DEST, UInt(Field(22, 6)), UInt(Field(32, 2)), Bit(51), 1, 7);
Internal(SRC0, UInt(Field(28, 2)), F_GPI, T_F32);
Internal(SRC2, UInt(Field(12, 2)), F_GPI, T_F32);
Vec34Swizzle(SRC1, UInt(Field(6, 4)), Bit(10), type);
Vec34Swizzle(SRC0, UInt(Field(18, 4)), Bit(34), type);
Vec34Swizzle(SRC2, UInt(Field(14, 4)), Bit(54), type);
AddFlags(SRC1, F_ABS * Bit(37) + F_NEG * Bit(38));
AddFlags(SRC0, F_ABS * Bit(46) + F_NEG * Bit(11));
AddFlags(SRC2, F_ABS * Bit(35) + F_NEG * Bit(36));
Multiplier(2, 2, 2, 4);
foreach (r from 0 to UInt(Field(44, 2))) {
    if not_bool(Failed()) then {
        Load(A, SRC0, mask, Rep(SRC0, r, O_SRC0, mode));
        Load(B, SRC1, mask, Rep(SRC1, r, O_SRC1, mode));
        Load(C, SRC2, mask, Rep(SRC2, r, O_SRC2, mode));
        Reset(R, Count(A), K_FLOAT);
        foreach (i from 0 to Count(A) - 1) Put(R, i, FFma(At(A, i), At(B, i), At(C, i)));
        Store(DEST, R, mask, Rep(DEST, r, O_DEST, mode))
    }
};
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).