INVERT_COND = immediate("invert_cond")
NEST = immediate("nest")
TARGET = immediate("target", "agx_block *")
+PERSPECTIVE = immediate("perspective", "bool")
SR = enum("sr", {
0: 'threadgroup_position_in_grid.x',
1: 'threadgroup_position_in_grid.y',
op("bitop", (0x7E, 0x7F, 6, _), srcs = 2, imms = [TRUTH_TABLE])
op("convert", (0x3E | L, 0x7F | L | (0x3 << 38), 6, _), srcs = 2, imms = [ROUND])
-op("ld_vary", (0x21, 0x3F, 8, _), srcs = 1, imms = [CHANNELS])
+op("ld_vary", (0x21, 0x3F, 8, _), srcs = 1, imms = [CHANNELS, PERSPECTIVE])
op("st_vary", None, dests = 0, srcs = 2, can_eliminate = False)
op("stop", (0x88, 0xFFFF, 2, _), dests = 0, can_eliminate = False)
op("trap", (0x08, 0xFFFF, 2, _), dests = 0, can_eliminate = False)
case AGX_OPCODE_LD_VARY:
{
unsigned D = agx_pack_alu_dst(I->dest[0]);
- bool perspective = 1; // TODO
unsigned channels = (I->channels & 0x3);
assert(I->mask < 0xF); /* 0 indicates full mask */
agx_index index_src = I->src[0];
unsigned index = index_src.value;
uint64_t raw =
- 0x21 | (perspective ? (1 << 6) : 0) |
+ 0x21 | (I->perspective ? (1 << 6) : 0) |
((D & 0xFF) << 7) |
(1ull << 15) | /* XXX */
(((uint64_t) index) << 16) |