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 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | |||||||||||||||||||
| 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 |
| Rb | pred.not | pred | Rd | ||||||||||||||||||||||||||||
bits 63:48: 1111 1011 1110 0---
Runs execute_OUT with Form() 0.
| 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 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | cbuf.bank | cbuf.offset | |||||||||||||||||
| 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 |
| cbuf.offset | pred.not | pred | Rd | ||||||||||||||||||||||||||||
bits 63:48: 1110 1011 1110 0---
Runs execute_OUT with Form() 1.
| 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 | 1 | 1 | imm.sign | 1 | 1 | 1 | 0 | 0 | imm | ||||||||||||||||||
| 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 |
| imm | pred.not | pred | Rd | ||||||||||||||||||||||||||||
bits 63:48: 1111 011- 1110 0---
Runs execute_OUT with Form() 2.
The operation reads some of these fields in some forms alone (it chooses by Form()), so the diagrams show only the decoder's.
| Field | Bits | From |
|---|---|---|
| [40] | 40 | execute_OUT |
| [39] | 39 | execute_OUT |
| Rb | 27:20 | RegB() |
| stream0 | 21:20 | execute_OUT |
| pred.not | 19 | the decoder |
| pred | 18:16 | the decoder |
| Rd | 7:0 | Dst() |
OUT: a geometry program's vertex emitted (bit 39) and its primitive cut (bit 40) on the stream that the register at 20, the constant buffer word or the immediate names (its low two bits). Each stream the program uses is a selection of its own; stream 0's vertex is the vertex stages' end (transform feedback, the position's fix, the primitive's number), another's its transform feedback's capture. d becomes the next output's handle, 0
let stream0 = match Form() { 2 => ZeroExtend(Field(20, 2), 32), 1 => CbufWord(), _ => R_read(RegB()) };
let stream = Bits32(stream0) & 0x00000003; /* a word at run time, an immediate's too */
foreach (target from 0 to 3) {
if target == 0 | MOD(DIV(StreamMask(), 2 ^ target), 2) == 1 then {
StreamSelect(stream, target);
if Field(39, 1) == 0b1 then {
if target == 0 then VertexEnd() else XfbCapture(target);
EmitVertex(target);
if HasPointSize(true) & not_bool(PointSizeUsed()) then DefaultPointSize()
};
if Field(40, 1) == 0b1 then EndPrimitive(target);
StreamEnd()
}
};
R_write(Dst(), 0x00000000)
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).