agx: Count read registers as well

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11751>
This commit is contained in:
Alyssa Rosenzweig
2021-06-19 14:33:30 -04:00
committed by Marge Bot
parent f03cecf05f
commit 15b49a6795
@@ -30,6 +30,20 @@
* TODO: Handle phi nodes.
*/
/** Returns number of registers read by an instruction. TODO: 16-bit */
static unsigned
agx_read_registers(agx_instr *I, unsigned s)
{
unsigned size = I->src[s].size == AGX_SIZE_32 ? 2 : 1;
switch (I->op) {
case AGX_OPCODE_DEVICE_LOAD:
return 8;
default:
return size;
}
}
/** Returns number of registers written by an instruction */
static unsigned
agx_write_registers(agx_instr *I, unsigned d)