ULDC (indexed)

Memory

fixed bit field field the encoding fixes should be

Encoding

12712612512412312212112011911811711611511411311211111010910810710610510410310210110099989796
reusewaitrd_barwr_baryieldstall
9594939291908988878685848382818079787776757473727170696867666564
kind
6362616059585756555453525150494847464544434241403938373635343332
bankoff
313029282726252423222120191817161514131211109876543210
indexdpred.notpred101010111011

bits 15:0: ---- 1010 1011 1011

ULDC UR, c[bank][UR + offset]: the uniform register at 24, the offset signed (CuAssembler sm_86, cAURI)

Runs execute_ULDC_IDX.

Fields

FieldBitsFrom
reuse125:122the decoder
wait121:116the decoder
rd_bar115:113the decoder
wr_bar112:110the decoder
yield109the decoder
stall108:105the decoder
kind75:73execute_ULDC_IDX
bank58:54execute_ULDC_IDX
off53:38execute_ULDC_IDX
index29:24execute_ULDC_IDX
d21:16execute_ULDC_IDX
pred.not15the decoder
pred14:12the decoder

Operation Sail

ULDC.IDX: ULDC UR, c[bank][UR + offset], the uniform register at 24, the offset 38-53 signed. Of NAK's MemType (73-75) as LDC's: a byte or a halfword (0 to 3) as CbufSubword reads it, a word, or a pair. One game's compute program walks a byte code in a constant buffer with ULDC.U8 UR, c[0x4][UR15 + k]

let kind = UInt(Field(73, 3));
let bank = UInt(Field(54, 5));
let off = UInt(Field(38, 16));
if kind > 5 then throw(Unsupported("ULDC (indexed) of type %u", kind));
let bias = if off >= 32768 then off - 65536 else off;
let d = UInt(Field(16, 6));
let index = U_read(UInt(Field(24, 6)));
if kind < 4 then U_write(d, CbufSubwordAt(bank, bias, index, kind)) else {
    U_write(d, CbufLoadAt(bank, bias, index));
    if kind == 5 & d < URZ then U_write(d + 1, CbufLoadAt(bank, bias + 4, index))
}

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 Mesa's NAK (sm70_encode.rs, MIT) and CuAssembler's sm_86 records.