mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-21 14:20:29 +01:00
ir3/opt_predicates: move some helpers up
We'll need them earlier in the next commit. Signed-off-by: Job Noorman <jnoorman@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36614>
This commit is contained in:
parent
0223ab01b7
commit
cccb3ecc6a
1 changed files with 13 additions and 13 deletions
|
|
@ -30,6 +30,19 @@ struct opt_predicates_ctx {
|
|||
struct hash_table *predicate_clones;
|
||||
};
|
||||
|
||||
static bool
|
||||
is_shared_or_const(struct ir3_register *reg)
|
||||
{
|
||||
return reg->flags & (IR3_REG_CONST | IR3_REG_SHARED);
|
||||
}
|
||||
|
||||
static bool
|
||||
cat2_needs_scalar_alu(struct ir3_instruction *instr)
|
||||
{
|
||||
return is_shared_or_const(instr->srcs[0]) &&
|
||||
(instr->srcs_count == 1 || is_shared_or_const(instr->srcs[1]));
|
||||
}
|
||||
|
||||
static struct ir3_instruction *
|
||||
clone_with_predicate_dst(struct opt_predicates_ctx *ctx,
|
||||
struct ir3_instruction *instr)
|
||||
|
|
@ -49,19 +62,6 @@ clone_with_predicate_dst(struct opt_predicates_ctx *ctx,
|
|||
return clone;
|
||||
}
|
||||
|
||||
static bool
|
||||
is_shared_or_const(struct ir3_register *reg)
|
||||
{
|
||||
return reg->flags & (IR3_REG_CONST | IR3_REG_SHARED);
|
||||
}
|
||||
|
||||
static bool
|
||||
cat2_needs_scalar_alu(struct ir3_instruction *instr)
|
||||
{
|
||||
return is_shared_or_const(instr->srcs[0]) &&
|
||||
(instr->srcs_count == 1 || is_shared_or_const(instr->srcs[1]));
|
||||
}
|
||||
|
||||
static bool
|
||||
can_write_predicate(struct opt_predicates_ctx *ctx,
|
||||
struct ir3_instruction *instr)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue