From ef4e07a1a27f3f6aaed659d3f84f8b77c9dc2e87 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Wed, 10 Feb 2021 19:47:18 +0100 Subject: [PATCH] ir3: Introduce phi and parallelcopy instructions Part-of: --- src/freedreno/ir3/instr-a3xx.h | 8 ++++++++ src/freedreno/ir3/ir3.h | 6 ++++++ src/freedreno/ir3/ir3_print.c | 8 +++++--- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/freedreno/ir3/instr-a3xx.h b/src/freedreno/ir3/instr-a3xx.h index e7f31fd..656ee2b 100644 --- a/src/freedreno/ir3/instr-a3xx.h +++ b/src/freedreno/ir3/instr-a3xx.h @@ -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)) diff --git a/src/freedreno/ir3/ir3.h b/src/freedreno/ir3/ir3.h index 92b9bd1..6a37afa 100644 --- a/src/freedreno/ir3/ir3.h +++ b/src/freedreno/ir3/ir3.h @@ -310,6 +310,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; unsigned samp_base : 3; diff --git a/src/freedreno/ir3/ir3_print.c b/src/freedreno/ir3/ir3_print.c index 4eb5362..ff5c5bb 100644 --- a/src/freedreno/ir3/ir3_print.c +++ b/src/freedreno/ir3/ir3_print.c @@ -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; -- 2.7.4