System registers, votes, shuffles and barriers
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 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | |||||||||||||||||||
| 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 |
| sr | pred.not | pred | Rd | ||||||||||||||||||||||||||||
bits 63:48: 1111 0000 1100 1---
Runs execute_S2R with Form() 0.
| Field | Bits | From |
|---|---|---|
| sr | 27:20 | execute_S2R |
| pred.not | 19 | the decoder |
| pred | 18:16 | the decoder |
| Rd | 7:0 | Dst() |
S2R: the system register at 20
let sr = UInt(Field(20, 8));
let stage = Stage();
let value : bits(32) =
/* the thread ids, SR_TID.X to .Z (0x21-0x23), and the block's, SR_CTAID.X to .Z (0x25-0x27) */
if stage == ST_CS & ((sr >= 33 & sr <= 35) | (sr >= 37 & sr <= 39)) then {
let local = sr <= 35;
VecAt(ComputeIds(local), if local then sr - 33 else sr - 37)
} else if sr == 0 | (sr >= 56 & sr <= 60) then {
/* SR_LANEID, and the EQ, LT, LE, GT and GE lane masks of a 32-lane warp */
let lane = LaneId() & 0x0000001f;
let eq = 0x00000001 << lane;
let lt = eq - 0x00000001;
let le = lt | eq;
match sr { 0 => lane, 56 => eq, 57 => lt, 58 => le, 59 => not_vec(le), _ => not_vec(lt) }
} else if stage == ST_CS & sr == 32 then {
/* SR_TID packed: x in bits 0-15, y in 16-25 and z in 26-31, the widths of the largest block (Eden gives y
8 bits) */
let tid = ComputeIds(true);
let x = VecAt(tid, 0);
let xy = BitsInsert(x, VecAt(tid, 1), 0x00000010, 0x0000000a);
BitsInsert(xy, VecAt(tid, 2), 0x0000001a, 0x00000006)
} else if stage == ST_FS & sr == 19 then (if LaneDead() then 0xffffffff else 0x00000000) /* SR_THREAD_KILL */
else if sr == 17 then InvocationId() /* SR_INVOCATION_ID */
else if sr >= 80 & sr <= 83 then ClockAt(ReadClock(if sr < 82 then 3 else 1), MOD(sr, 2))
else if sr == 29 & Between() then {
/* SR_INVOCATION_INFO: the vertices of the input primitive in bits 16-23, with the primitive's index in the
batch (bits 0-7) 0, which makes the index the program builds for ISBERD the vertex's. Citron,
acfb1dcc1ad9adf25b960c4f8f25c5bf78849406: geometry's input topology is known when translating. Its
invocation info is a constant; tessellation remains dynamic */
if stage == ST_GS then to_bits(32, InVertices() * 65536) else PatchVertices() << 16
}
/* Direct CBE writes are disabled: their enable and address registers (0x15..0x17) are zero */
else if sr == 18 then 0x3f800000
else if sr == 29 & stage != ST_FS then 0x00ff0000
else 0x00000000;
R_write(Dst(), value)
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 Eden's maxwell.inc (GPL-2.0-or-later).