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 | 1 | 1 | 1 | 1 | pred | skipinv | onceonly | syncstart | dest_ext | src1_neg | src1_ext | src2_ext | prec | vscomp | repeat_count | sign_test | zero_test | crcomb_and | mask_type | 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 | wben | alu_sel | alu_op | src1_n | src2_n | ||||||||||||||||||||||||
bits 63:0: 0111 1xxx x-xx xxxx xxxx xxxx x-xx --xx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
It is in a group of patterns that may match the same word: the decoder tries them in this order, and the first that matches decodes it: VPCK, VTST, VTSTMSK, VBW.
Runs execute_VTSTMSK with Form() 0.
| Field | Bits | The Sail reads it in |
|---|---|---|
| pred | 58:56 | |
| skipinv | 55 | |
| onceonly | 53 | |
| syncstart | 52 | |
| dest_ext | 51 | Bit(51) |
| src1_neg | 50 | Bit(50) |
| src1_ext | 49 | Bit(49) |
| src2_ext | 48 | Bit(48) |
| prec | 47 | Bit(47) |
| vscomp | 46 | Bit(46) |
| repeat_count | 45:44 | |
| sign_test | 43:42 | Test |
| zero_test | 41:40 | Test |
| crcomb_and | 39 | |
| mask_type | 37:36 | execute_VTSTMSK |
| dest_bank | 33:32 | execute_VTSTMSK |
| src1_bank | 31:30 | TestSources |
| src2_bank | 29:28 | TestSources |
| dest_n | 27:21 | execute_VTSTMSK |
| wben | 20 | Bit(20) |
| alu_sel | 19:18 | execute_VTSTMSK |
| alu_op | 17:14 | execute_VTSTMSK |
| src1_n | 13:7 | TestSources |
| src2_n | 6:0 | TestSources |
VTSTMSK: the test's result as a mask into the destination: all ones (a float's 1.0, a signed type's largest) where it holds, else zero, in each component (of a vector test's four with mask type 2)
let sel = UInt(Field(18, 2));
let alu_op = UInt(Field(14, 4));
let op = TestOp(sel, alu_op);
let type = TestType(sel, alu_op, Bit(47));
if op == TO_INVALID | type == T_UNK then throw(Refuse("VTSTMSK of ALU %u operation %u", sel, alu_op));
let mask_type = UInt(Field(36, 2));
if mask_type == 3 then throw(Refuse("VTSTMSK of mask type 3"));
if Bit(20) == 0 then throw(Refuse("VTSTMSK without its write"));
TestSources(sel, type);
let doubled = sel == 0;
let four = doubled & mask_type == 2;
Dest(DEST, UInt(Field(21, 7)), UInt(Field(32, 2)), Bit(51), doubled, if doubled then 8 else 7);
SetType(DEST, type);
let n = Test(op, if op == TO_DP | four then 15 else 1);
if n == 0 then throw(Stop());
let kind = if IsFloatType(type) then K_FLOAT else if IsSignedType(type) then K_INT else K_UINT;
let zero = ZeroOf(kind);
let ones = if type == T_F16 | type == T_F32 then One() else if type == T_I8 then SConst(127)
else if type == T_I16 then SConst(32767) else if type == T_I32 then SConst(2147483647)
else if type == T_U8 then UConst(255) else if type == T_U16 then UConst(65535) else UConst(4294967295);
Reset(R, n, kind);
foreach (i from 0 to n - 1) Put(R, i, if TestAt(i) then ones else zero);
Store(DEST, R, 15, 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).