fixed bit field field the encoding fixes should be
| 63 | 62 | 61 | 60 | 59 | 58 | 57 | 56 | 55 | 54 | 53 | 52 | 51 | 50 | 49 | 48 | 47 | 46 | 45 | 44 | 43 | 42 | 41 | 40 | 39 | 38 | 37 | 36 | 35 | 34 | 33 | 32 |
| 0 | 0 | 0 | 1 | 1 | pred | skipinv | clip_plane_enable | 0 | opcode2 | dest_ext | end | src1_ext | repeat_mode | gpi0_abs | repeat_count | nosched | mask | src1_neg | src1_abs | clip_plane_n | dest_bank | ||||||||||
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| src1_bank | gpi0_n | dest_n | gpi0_swiz | src1_swiz_w | src1_swiz_z | src1_swiz_y | src1_swiz_x | src1_n | |||||||||||||||||||||||
bits 63:0: 0001 1xxx xx0x xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
Runs execute_VDP with Form() 0.
| Field | Bits | The Sail reads it in |
|---|---|---|
| pred | 58:56 | |
| skipinv | 55 | |
| clip_plane_enable | 54 | |
| opcode2 | 52 | Bit(52) |
| dest_ext | 51 | Bit(51) |
| end | 50 | |
| src1_ext | 49 | Bit(49) |
| repeat_mode | 48:47 | execute_VDP |
| gpi0_abs | 46 | Bit(46) |
| repeat_count | 45:44 | execute_VDP |
| nosched | 43 | |
| mask | 42:39 | execute_VDP |
| src1_neg | 38 | Bit(38) |
| src1_abs | 37 | Bit(37) |
| clip_plane_n | 36:34 | |
| dest_bank | 33:32 | execute_VDP |
| src1_bank | 31:30 | execute_VDP |
| gpi0_n | 29:28 | execute_VDP |
| dest_n | 27:22 | execute_VDP |
| gpi0_swiz | 21:18 | execute_VDP |
| src1_swiz_w | 17:15 | execute_VDP |
| src1_swiz_z | 14:12 | execute_VDP |
| src1_swiz_y | 11:9 | execute_VDP |
| src1_swiz_x | 8:6 | execute_VDP |
| src1_n | 5:0 | execute_VDP |
VDP: the dot product of src1 (its channels each named, its modifiers) and the GPI register gpi0, of three components (vec4: four), into the one component the mask names, which turns a component on each repeat
let type = if Bit(52) == 1 then 2 else 1;
let source_mask = if Bit(52) == 1 then 15 else 7;
let mode = UInt(Field(47, 2));
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(SRC2, UInt(Field(28, 2)), F_GPI, T_F32);
Vec34Swizzle(SRC2, UInt(Field(18, 4)), 0, type);
SetSwizzle(SRC1, UInt(Field(6, 3)), UInt(Field(9, 3)), UInt(Field(12, 3)), UInt(Field(15, 3)));
AddFlags(SRC1, F_NEG * Bit(38) + F_ABS * Bit(37));
if Bit(46) == 1 then AddFlags(SRC2, F_ABS);
var mask : int = UInt(Field(39, 4));
foreach (r from 0 to UInt(Field(44, 2))) {
if not_bool(Failed()) then {
Load(A, SRC1, source_mask, Rep(SRC1, r, O_SRC1, mode));
Load(B, SRC2, source_mask, Rep(SRC2, r, O_SRC2, mode));
if not_bool(Failed()) then {
var sum : bits(32) = FMul(At(A, 0), At(B, 0));
foreach (i from 1 to Count(A) - 1) { sum = FFma(At(A, i), At(B, i), sum) };
Reset(R, 1, K_FLOAT);
Put(R, 0, sum);
Store(DEST, R, mask, 0);
mask = MOD(mask * 2 + DIV(mask, 8), 16)
}
}
}
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).