From a567f60b3ee86adbd015b1ce14728d488972cb8f Mon Sep 17 00:00:00 2001 From: Italo Nicola Date: Tue, 20 Apr 2021 19:40:27 +0000 Subject: [PATCH] pan/mdg: add helpers for load/store special read regs Signed-off-by: Italo Nicola Reviewed-by: Alyssa Rosenzweig Part-of: --- src/panfrost/midgard/helpers.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/panfrost/midgard/helpers.h b/src/panfrost/midgard/helpers.h index f89e7520454..fa882f07824 100644 --- a/src/panfrost/midgard/helpers.h +++ b/src/panfrost/midgard/helpers.h @@ -153,6 +153,21 @@ #define REGISTER_TEXTURE_BASE 28 #define REGISTER_SELECT 31 +/* The following registers are read-only */ + +/* XY is Program Counter, ZW is Stack Pointer */ +#define REGISTER_LDST_PC_SP 2 + +/* XY is Thread Local Storage pointer, ZW is Workgroup Local Storage pointer */ +#define REGISTER_LDST_LOCAL_STORAGE_PTR 3 + +#define REGISTER_LDST_LOCAL_THREAD_ID 4 +#define REGISTER_LDST_GROUP_ID 5 +#define REGISTER_LDST_GLOBAL_THREAD_ID 6 + +/* This register is always zeroed when read. */ +#define REGISTER_LDST_ZERO 7 + /* SSA helper aliases to mimic the registers. */ #define SSA_FIXED_SHIFT 24 @@ -247,6 +262,9 @@ struct mir_tag_props { /* Some fields such swizzle and address have special meanings */ #define LDST_ATOMIC (1 << 6) +/* Operates on attributes/varyings (including images) */ +#define LDST_ATTRIB (1 << 7) + /* This file is common, so don't define the tables themselves. #include * midgard_op.h if you need that, or edit midgard_ops.c directly */