ir3: Introduce phi and parallelcopy instructions

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9842>
This commit is contained in:
Connor Abbott 2021-02-10 19:47:18 +01:00 committed by Emma Anholt
parent e380229bde
commit ef4e07a1a2
3 changed files with 19 additions and 3 deletions

View file

@ -314,6 +314,14 @@ typedef enum {
*/
OPC_META_TEX_PREFETCH = _OPC(-1, 4),
/* Parallel copies have multiple destinations, and copy each destination
* to its corresponding source. This happens "in parallel," meaning that
* it happens as-if every source is read first and then every destination
* is stored. These are produced in RA when register shuffling is
* required, and then lowered away immediately afterwards.
*/
OPC_META_PARALLEL_COPY = _OPC(-1, 5),
OPC_META_PHI = _OPC(-1, 6),
} opc_t;
#define opc_cat(opc) ((int)((opc) >> NOPC_BITS))

View file

@ -309,6 +309,12 @@ struct ir3_instruction {
*/
unsigned *outidxs;
} end;
struct {
/* used to temporarily hold reference to nir_phi_instr
* until we resolve the phi srcs
*/
void *nphi;
} phi;
struct {
unsigned samp, tex;
unsigned input_offset;

View file

@ -99,9 +99,11 @@ static void print_instr_name(struct ir3_instruction *instr, bool flags)
if (is_meta(instr)) {
switch (instr->opc) {
case OPC_META_INPUT: printf("_meta:in"); break;
case OPC_META_SPLIT: printf("_meta:split"); break;
case OPC_META_COLLECT: printf("_meta:collect"); break;
case OPC_META_TEX_PREFETCH: printf("_meta:tex_prefetch"); break;
case OPC_META_SPLIT: printf("_meta:split"); break;
case OPC_META_COLLECT: printf("_meta:collect"); break;
case OPC_META_TEX_PREFETCH: printf("_meta:tex_prefetch"); break;
case OPC_META_PARALLEL_COPY: printf("_meta:parallel_copy"); break;
case OPC_META_PHI: printf("_meta:phi"); break;
/* shouldn't hit here.. just for debugging: */
default: printf("_meta:%d", instr->opc); break;