fixed bit field field the encoding fixes should be
| 127 | 126 | 125 | 124 | 123 | 122 | 121 | 120 | 119 | 118 | 117 | 116 | 115 | 114 | 113 | 112 | 111 | 110 | 109 | 108 | 107 | 106 | 105 | 104 | 103 | 102 | 101 | 100 | 99 | 98 | 97 | 96 |
| reuse | wait | rd_bar | wr_bar | yield | stall | ||||||||||||||||||||||||||
| 95 | 94 | 93 | 92 | 91 | 90 | 89 | 88 | 87 | 86 | 85 | 84 | 83 | 82 | 81 | 80 | 79 | 78 | 77 | 76 | 75 | 74 | 73 | 72 | 71 | 70 | 69 | 68 | 67 | 66 | 65 | 64 |
| kind | |||||||||||||||||||||||||||||||
| 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 |
| bank | off | ||||||||||||||||||||||||||||||
| 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 |
| index | d | pred.not | pred | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | ||||||||||||||||
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.
| Field | Bits | From |
|---|---|---|
| reuse | 125:122 | the decoder |
| wait | 121:116 | the decoder |
| rd_bar | 115:113 | the decoder |
| wr_bar | 112:110 | the decoder |
| yield | 109 | the decoder |
| stall | 108:105 | the decoder |
| kind | 75:73 | execute_ULDC_IDX |
| bank | 58:54 | execute_ULDC_IDX |
| off | 53:38 | execute_ULDC_IDX |
| index | 29:24 | execute_ULDC_IDX |
| d | 21:16 | execute_ULDC_IDX |
| pred.not | 15 | the decoder |
| pred | 14:12 | the decoder |
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.