Integer and 8-bit color instructions
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 |
| 1 | 0 | 1 | 0 | 1 | pred | src0_high | nosched | src1_high | src2_high | dest_ext | end | src1_ext | src2_ext | 0 | repeat_count | is_signed | is_sat | 0 | 0 | src2_type | 0 | 0 | 0 | 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 | src0_n | src1_n | src2_n | ||||||||||||||||||||||||||
bits 63:0: 1010 1xxx -xxx xxxx 0xxx xx00 xx00 0xxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
Runs execute_I32MAD with Form() 0.
| Field | Bits | The Sail reads it in |
|---|---|---|
| pred | 58:57 | |
| src0_high | 56 | Bit(56) |
| nosched | 54 | |
| src1_high | 53 | Bit(53) |
| src2_high | 52 | Bit(52) |
| dest_ext | 51 | Bit(51) |
| end | 50 | |
| src1_ext | 49 | Bit(49) |
| src2_ext | 48 | Bit(48) |
| repeat_count | 46:44 | execute_I32MAD |
| is_signed | 43 | Bit(43) |
| is_sat | 42 | |
| src2_type | 39:38 | execute_I32MAD |
| src0_bank | 34 | Bit(34) |
| dest_bank | 33:32 | execute_I32MAD |
| src1_bank | 31:30 | execute_I32MAD |
| src2_bank | 29:28 | execute_I32MAD |
| dest_n | 27:21 | execute_I32MAD |
| src0_n | 20:14 | execute_I32MAD |
| src1_n | 13:7 | execute_I32MAD |
| src2_n | 6:0 | execute_I32MAD |
I32MAD: src0 * src1 + src2 of 16-bit sources (each its high half where it says; src2 type 2 a 32-bit source), a 32-bit result. A repeat at a time
Dest(DEST, UInt(Field(21, 7)), UInt(Field(32, 2)), Bit(51), 0, 7);
Src0(SRC0, UInt(Field(14, 7)), Bit(34), 0, 0, 7);
Src12(SRC1, UInt(Field(7, 7)), UInt(Field(30, 2)), Bit(49), 0, 7);
Src12(SRC2, UInt(Field(0, 7)), UInt(Field(28, 2)), Bit(48), 0, 7);
let signed = Bit(43) == 1;
let wide = if signed then T_I32 else T_U32;
let narrow = if signed then T_I16 else T_U16;
let src2_type = UInt(Field(38, 2));
SetType(DEST, wide);
SetType(SRC0, narrow);
SetType(SRC1, narrow);
SetType(SRC2, if src2_type == 2 then wide else narrow);
let m0 = if Bit(56) == 1 then 2 else 1;
let m1 = if Bit(53) == 1 then 2 else 1;
let m2 = if src2_type != 2 & Bit(52) == 1 then 2 else 1;
Multiplier(1, 1, 1, 1);
foreach (r from 0 to UInt(Field(44, 3))) {
if not_bool(Failed()) then {
Load(A, SRC0, m0, Rep(SRC0, r, O_SRC0, R_SLMSI));
Load(B, SRC1, m1, Rep(SRC1, r, O_SRC1, R_SLMSI));
Load(C, SRC2, m2, Rep(SRC2, r, O_SRC2, R_SLMSI));
if not_bool(Failed()) then {
Imad();
Store(DEST, R, 1, 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).