VDUAL

Vector float instructions

fixed bit field field the encoding fixes should be

Encoding

6362616059585756555453525150494847464544434241403938373635343332
0010comp_count_typegpi1_negsv_predskipinvop1_ext_vec3_or_has_w_vec4type_f16gpi1_swiz_extunified_store_swizunified_store_negop1op2_extprim_ustoregpi0_swizgpi1_swizprim_dest_bank
313029282726252423222120191817161514131211109876543210
unified_store_slot_bankprim_dest_num_gpiprim_dest_numop2src_configgpi2_slot_num_bit_1gpi2_slot_num_bit_0_or_unified_store_absgpi1_slot_numgpi0_slot_numwrite_mask_non_gpiunified_store_slot_num

bits 63:0: 0010 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx

Runs execute_VDUAL with Form() 0.

Fields

FieldBitsThe Sail reads it in
comp_count_type59Bit(59)
gpi1_neg58
sv_pred57:56
skipinv55
op1_ext_vec3_or_has_w_vec454Bit(54)
type_f1653Bit(53)
gpi1_swiz_ext52
unified_store_swiz51:48
unified_store_neg47
op146:44execute_VDUAL
op2_ext43Bit(43)
prim_ustore42Bit(42)
gpi0_swiz41:38
gpi1_swiz37:34
prim_dest_bank33:32execute_VDUAL
unified_store_slot_bank31:30
prim_dest_num_gpi29:28execute_VDUAL
prim_dest_num27:21execute_VDUAL
op220:18execute_VDUAL
src_config17:16execute_VDUAL
gpi2_slot_num_bit_115
gpi2_slot_num_bit_0_or_unified_store_abs14
gpi1_slot_num13:12
gpi0_slot_num11:10
write_mask_non_gpi9:7execute_VDUAL
unified_store_slot_num6:0

Operation Sail

VDUAL: two operations that share their register reads, op1 into the unified store or the internal register (prim_ustore), op2 into the other, both written after both are evaluated

let cct = Bit(59);
let ext = Bit(54);
let f16 = Bit(53);
let ustore = Bit(42) == 1;
let op1 = (if cct == 0 & ext == 1 then 8 else 0) + UInt(Field(44, 3));
let op2 = 8 * Bit(43) + UInt(Field(18, 3));
if op1 >= 14 | op2 == 0 | op2 >= 14 then throw(Refuse("VDUAL opcode"));
let n1 = DualSources(op1);
let n2 = DualSources(op2);
let unified_vector = if ustore then DualVectorStore(op1) else DualVectorStore(op2);
let type = if f16 == 1 then T_F16 else T_F32;
Internal(GPI_DEST, UInt(Field(28, 2)), 0, type);
Dest(UNIFIED, UInt(Field(21, 7)), UInt(Field(32, 2)), 0, unified_vector, if unified_vector then 8 else 7);
SetType(UNIFIED, type);
let op1_dest = if ustore then UNIFIED else GPI_DEST;
let op2_dest = if ustore then GPI_DEST else UNIFIED;
if not_bool(DualLayouts(n1, n2, UInt(Field(16, 2)))) then throw(Refuse("VDUAL source layout"));
let fixed_mask = UInt(Field(7, 3)) + (if cct == 1 & ext == 1 then 8 else 0);
let op1_mask = if ustore then DualMask(BankOf(op1_dest), DualVectorStore(op1), cct, f16) else fixed_mask;
let op2_mask = if ustore then fixed_mask else DualMask(BankOf(op2_dest), DualVectorStore(op2), cct, f16);
foreach (i from 0 to n1 - 1) DualSource(2 + i, 1, i, n1, type, DualVectorLoad(op1));
foreach (i from 0 to n2 - 1) DualSource(5 + i, 2, i, n1, type, DualVectorLoad(op2));
if Failed() then throw(Stop());
DualAlu(op1, 2, n1, op1_mask, cct, R1);
DualAlu(op2, 5, n2, op2_mask, cct, R2);
if Failed() then throw(Stop());
Store(op1_dest, R1, op1_mask, 0);
Store(op2_dest, R2, op2_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).