summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Abbott <cwabbott0@gmail.com>2023-03-02 13:09:35 +0100
committerMarge Bot <emma+marge@anholt.net>2024-04-26 12:55:13 +0000
commit497fcd26b51e7be7ddcd30a6450e1fa273af6206 (patch)
tree6b54f16300b1ca503cb5aad71fb99539813db4eb
parent736570b74d25b67acc5e681aa080c4f61320d36d (diff)
ir3: Add builder support for shared immediates
In addition to replacing existing no-longer-needed usage of the readfirst macro, we will use this for other NIR ALU instructions that need to materialize constants when they use the shared ALU. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22075>
-rw-r--r--src/freedreno/ir3/ir3.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/freedreno/ir3/ir3.h b/src/freedreno/ir3/ir3.h
index 0e2ec78560d..b295f57f02e 100644
--- a/src/freedreno/ir3/ir3.h
+++ b/src/freedreno/ir3/ir3.h
@@ -2155,7 +2155,7 @@ type_flags(type_t type)
}
static inline struct ir3_instruction *
-create_immed_typed(struct ir3_block *block, uint32_t val, type_t type)
+create_immed_typed_shared(struct ir3_block *block, uint32_t val, type_t type, bool shared)
{
struct ir3_instruction *mov;
ir3_register_flags flags = type_flags(type);
@@ -2163,16 +2163,28 @@ create_immed_typed(struct ir3_block *block, uint32_t val, type_t type)
mov = ir3_instr_create(block, OPC_MOV, 1, 1);
mov->cat1.src_type = type;
mov->cat1.dst_type = type;
- __ssa_dst(mov)->flags |= flags;
+ __ssa_dst(mov)->flags |= flags | (shared ? IR3_REG_SHARED : 0);
ir3_src_create(mov, 0, IR3_REG_IMMED | flags)->uim_val = val;
return mov;
}
static inline struct ir3_instruction *
+create_immed_typed(struct ir3_block *block, uint32_t val, type_t type)
+{
+ return create_immed_typed_shared(block, val, type, false);
+}
+
+static inline struct ir3_instruction *
+create_immed_shared(struct ir3_block *block, uint32_t val, bool shared)
+{
+ return create_immed_typed_shared(block, val, TYPE_U32, shared);
+}
+
+static inline struct ir3_instruction *
create_immed(struct ir3_block *block, uint32_t val)
{
- return create_immed_typed(block, val, TYPE_U32);
+ return create_immed_shared(block, val, false);
}
static inline struct ir3_instruction *