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 | 0 | 0 | dat_fmt | pred | skipinv | src0_swiz2 | syncstart | src0_abs | src1_ext | src2_ext | src2_swiz | src1_swiz2 | nosched | mask | src1_mod | src2_mod | src0_bank | 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 | src2_bank | dest_n | src1_swiz01 | src0_swiz01 | src0_n | src1_n | src2_n | ||||||||||||||||||||||||
bits 63:0: 0000 0xxx x-xx -xxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
Runs execute_VMAD2 with Form() 0.
| Field | Bits | The Sail reads it in |
|---|---|---|
| dat_fmt | 58 | Bit(58) |
| pred | 57:56 | |
| skipinv | 55 | |
| src0_swiz2 | 53 | Bit(53) |
| syncstart | 52 | |
| src0_abs | 50 | Bit(50) |
| src1_ext | 49 | Bit(49) |
| src2_ext | 48 | Bit(48) |
| src2_swiz | 47:45 | execute_VMAD2 |
| src1_swiz2 | 44 | Bit(44) |
| nosched | 43 | |
| mask | 42:39 | execute_VMAD2 |
| src1_mod | 38:37 | execute_VMAD2 |
| src2_mod | 36:35 | execute_VMAD2 |
| src0_bank | 34 | Bit(34) |
| dest_bank | 33:32 | execute_VMAD2 |
| src1_bank | 31:30 | execute_VMAD2 |
| src2_bank | 29:28 | execute_VMAD2 |
| dest_n | 27:22 | execute_VMAD2 |
| src1_swiz01 | 21:20 | execute_VMAD2 |
| src0_swiz01 | 19:18 | execute_VMAD2 |
| src0_n | 17:12 | execute_VMAD2 |
| src1_n | 11:6 | execute_VMAD2 |
| src2_n | 5:0 | execute_VMAD2 |
VMAD2: src0 * src1 + src2 rounded once, of the components the mask enables
let f16 = Bit(58); let type = if f16 == 1 then T_F16 else T_F32; Dest(DEST, UInt(Field(22, 6)), UInt(Field(32, 2)), 0, 1, 7); Src0(SRC0, UInt(Field(12, 6)), Bit(34), 0, 1, 7); Src12(SRC1, UInt(Field(6, 6)), UInt(Field(30, 2)), Bit(49), 1, 7); Src12(SRC2, UInt(Field(0, 6)), UInt(Field(28, 2)), Bit(48), 1, 7); let mask = WriteMask(DEST, UInt(Field(39, 4)), f16); SetType(DEST, type); SetType(SRC0, type); SetType(SRC1, type); SetType(SRC2, type); SetSwizzleCode(SRC0, Vmad2Swizzle(0, UInt(Field(18, 2)) + 4 * Bit(53))); SetSwizzleCode(SRC1, Vmad2Swizzle(1, UInt(Field(20, 2)) + 4 * Bit(44))); SetSwizzleCode(SRC2, Vmad2Swizzle(2, UInt(Field(45, 3)))); if Bit(50) == 1 then AddFlags(SRC0, F_ABS); SetFlags(SRC1, Modifier(UInt(Field(37, 2)))); SetFlags(SRC2, Modifier(UInt(Field(35, 2)))); Load(A, SRC0, mask, 0); Load(B, SRC1, mask, 0); Load(C, SRC2, mask, 0); if Failed() then throw(Stop()); 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, 0)
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).