From d7f141bb353f632ef3a77694e56c92dab8c085f2 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 30 Dec 2020 15:00:44 -0800 Subject: [PATCH] freedreno/ir3: Add cat5/cat6 nonuniform flag Not yet used by the compiler, but needed so we don't loose information between ir3 parser and instruction encoding. Currently ignored for cat5, because the uniform vs non-uniform default is swapped there. Signed-off-by: Rob Clark Part-of: --- src/freedreno/ir3/ir3.c | 9 +++++++-- src/freedreno/ir3/ir3.h | 8 +++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/freedreno/ir3/ir3.c b/src/freedreno/ir3/ir3.c index 62f45fcd722..819e6823ebb 100644 --- a/src/freedreno/ir3/ir3.c +++ b/src/freedreno/ir3/ir3.c @@ -624,15 +624,20 @@ static int emit_cat6_a6xx(struct ir3_instruction *instr, void *ptr, if (instr->flags & IR3_INSTR_B) { if (ssbo->flags & IR3_REG_IMMED) { cat6->desc_mode = CAT6_BINDLESS_IMM; + } else if (instr->flags & IR3_INSTR_NONUNIF) { + cat6->desc_mode = CAT6_BINDLESS_NONUNIFORM; } else { cat6->desc_mode = CAT6_BINDLESS_UNIFORM; } cat6->base = instr->cat6.base; } else { - if (ssbo->flags & IR3_REG_IMMED) + if (ssbo->flags & IR3_REG_IMMED) { cat6->desc_mode = CAT6_IMM; - else + } else if (instr->flags & IR3_INSTR_NONUNIF) { + cat6->desc_mode = CAT6_NONUNIFORM; + } else { cat6->desc_mode = CAT6_UNIFORM; + } } } diff --git a/src/freedreno/ir3/ir3.h b/src/freedreno/ir3/ir3.h index 2ba28297e2c..ca930d7cf00 100644 --- a/src/freedreno/ir3/ir3.h +++ b/src/freedreno/ir3/ir3.h @@ -230,13 +230,15 @@ struct ir3_instruction { IR3_INSTR_SAT = 0x800, /* (cat5/cat6) Bindless */ IR3_INSTR_B = 0x1000, + /* (cat5/cat6) nonuniform */ + IR3_INSTR_NONUNIF = 0x02000, /* (cat5-only) Get some parts of the encoding from a1.x */ - IR3_INSTR_A1EN = 0x2000, + IR3_INSTR_A1EN = 0x04000, /* meta-flags, for intermediate stages of IR, ie. * before register assignment is done: */ - IR3_INSTR_MARK = 0x4000, - IR3_INSTR_UNUSED= 0x8000, + IR3_INSTR_MARK = 0x08000, + IR3_INSTR_UNUSED = 0x10000, } flags; uint8_t repeat; uint8_t nop;