VTST

Tests

fixed bit field field the encoding fixes should be

Encoding

6362616059585756555453525150494847464544434241403938373635343332
01001predskipinvonceonlysyncstartdest_extsrc1_negsrc1_extsrc2_extprecvscomprepeat_countsign_testzero_testcrcomb_andchanpdst_ndest_bank
313029282726252423222120191817161514131211109876543210
src1_banksrc2_bankdest_nwbenalu_selalu_opsrc1_nsrc2_n

bits 63:0: 0100 1xxx x-xx xxxx xxxx xxxx xxxx xxxx 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_VTST with Form() 0.

Fields

FieldBitsThe Sail reads it in
pred58:56
skipinv55
onceonly53
syncstart52
dest_ext51
src1_neg50Bit(50)
src1_ext49Bit(49)
src2_ext48Bit(48)
prec47Bit(47)
vscomp46Bit(46)
repeat_count45:44
sign_test43:42Test
zero_test41:40Test
crcomb_and39
chan38:36execute_VTST
pdst_n35:34execute_VTST
dest_bank33:32
src1_bank31:30TestSources
src2_bank29:28TestSources
dest_n27:21
wben20
alu_sel19:18execute_VTST
alu_op17:14execute_VTST
src1_n13:7TestSources
src2_n6:0TestSources

Operation Sail

VTST: the test of src1's and src2's component chan into predicate register pdst_n

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("VTST of ALU %u operation %u", sel, alu_op));
let chan = UInt(Field(36, 3));
if chan >= 4 then throw(Refuse("VTST of channel %u", chan));
TestSources(sel, type);
let n = Test(op, 2 ^ chan);
if n == 0 then throw(Stop());
PredWrite(UInt(Field(34, 2)), TestAt(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).