GPU/Shader Instruction Set: Difference between revisions
i0-i7 used for LOOP |
CMP |
||
Line 70: | Line 70: | ||
| 0x1A | | 0x1A | ||
| 0x6 | | 0x6 | ||
| Opcode | |||
|} | |||
Format 1c : (used for comparison instructions) | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset | |||
! Size (bits) | |||
! Description | |||
|- | |||
| 0x0 | |||
| 0x7 | |||
| Operand descriptor ID (DESC) | |||
|- | |||
| 0x7 | |||
| 0x7 | |||
| Source 1 register (SRC1) | |||
|- | |||
| 0xE | |||
| 0x5 | |||
| Source 2 register (SRC2) | |||
|- | |||
| 0x13 | |||
| 0x2 | |||
| Address register index (IDX) | |||
|- | |||
| 0x15 | |||
| 0x3 | |||
| Comparison operator for Y (CMPY) | |||
|- | |||
| 0x18 | |||
| 0x3 | |||
| Comparison operator for X (CMPX) | |||
|- | |||
| 0x1B | |||
| 0x5 | |||
| Opcode | | Opcode | ||
|} | |} | ||
Line 265: | Line 301: | ||
| 0x28 | | 0x28 | ||
| 2 | | 2 | ||
| IF | | IF | ||
| If condition (don't know how condition flags work yet) is true, then executes instructions until DST, then jumps to DST+NUM; else, jumps to DST | | If condition (don't know how condition flags work yet, based on cmp.x and cmp.y booleans set by CMP) is true, then executes instructions until DST, then jumps to DST+NUM; else, jumps to DST | ||
|- | |- | ||
| 0x29 | | 0x29 | ||
Line 288: | Line 324: | ||
| Jumps to DST if condition (don't know how condition flags work yet) is true, else does nothing. | | Jumps to DST if condition (don't know how condition flags work yet) is true, else does nothing. | ||
|- | |- | ||
| 0x2E | | 0x2E-0x2F | ||
| | | 1c | ||
| | | CMP | ||
| | | Sets booleans cmp.x and cmp.y based on the operand's x and y components and the CMPX and CMPY comparison operators respectively. | ||
|- | |- | ||
| 0x38-0x3F | | 0x38-0x3F |