From a2c1265dd34a97cfb1abd11fa44d8cf93187c99e Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 3 Mar 2020 07:45:33 -0500 Subject: [PATCH] pan/bi: Add special indices For fixed registers, uniforms, and constants, which bypass the usual SSA mechanism to map well to the ISA. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/compiler.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index faf83b96ac3..12a30dc9782 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -202,6 +202,25 @@ typedef struct { #define BIR_NO_ARG (0) #define BIR_IS_REG (1) +/* If high bits are set, instead of SSA/registers, we have specials indexed by + * the low bits if necessary. + * + * Fixed register: do not allocate register, do not collect $200. + * Uniform: access a uniform register given by low bits. + * Constant: access the specified constant + * Zero: special cased to avoid wasting a constant + */ + +#define BIR_INDEX_REGISTER (1 << 31) +#define BIR_INDEX_UNIFORM (1 << 30) +#define BIR_INDEX_CONSTANT (1 << 29) +#define BIR_INDEX_ZERO (1 << 28) + +/* Keep me synced please so we can check src & BIR_SPECIAL */ + +#define BIR_SPECIAL ((BIR_INDEX_REGISTER | BIR_INDEX_UNIFORM) | \ + (BIR_INDEX_CONSTANT | BIR_INDEX_ZERO) + static inline unsigned bir_ssa_index(nir_ssa_def *ssa) { -- 2.30.2