mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 03:28:09 +02:00
pan/midgard: Share mir_nontrivial_outmod
To be used with redundant move elimination. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
parent
b6946d35c8
commit
cb6dea6b4d
3 changed files with 17 additions and 16 deletions
|
|
@ -390,6 +390,7 @@ void mir_print_block(midgard_block *block);
|
|||
void mir_print_shader(compiler_context *ctx);
|
||||
bool mir_nontrivial_source2_mod(midgard_instruction *ins);
|
||||
bool mir_nontrivial_mod(midgard_vector_alu_src src, bool is_int, unsigned mask);
|
||||
bool mir_nontrivial_outmod(midgard_instruction *ins);
|
||||
|
||||
/* MIR goodies */
|
||||
|
||||
|
|
|
|||
|
|
@ -25,22 +25,6 @@
|
|||
#include "compiler.h"
|
||||
#include "midgard_ops.h"
|
||||
|
||||
static bool
|
||||
mir_nontrivial_outmod(midgard_instruction *ins)
|
||||
{
|
||||
bool is_int = midgard_is_integer_op(ins->alu.op);
|
||||
unsigned mod = ins->alu.outmod;
|
||||
|
||||
/* Type conversion is a sort of outmod */
|
||||
if (ins->alu.dest_override != midgard_dest_override_none)
|
||||
return true;
|
||||
|
||||
if (is_int)
|
||||
return mod != midgard_outmod_int_wrap;
|
||||
else
|
||||
return mod != midgard_outmod_none;
|
||||
}
|
||||
|
||||
bool
|
||||
midgard_opt_copy_prop(compiler_context *ctx, midgard_block *block)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -140,6 +140,22 @@ mir_nontrivial_source2_mod(midgard_instruction *ins)
|
|||
return mir_nontrivial_mod(src2, is_int, ins->mask);
|
||||
}
|
||||
|
||||
bool
|
||||
mir_nontrivial_outmod(midgard_instruction *ins)
|
||||
{
|
||||
bool is_int = midgard_is_integer_op(ins->alu.op);
|
||||
unsigned mod = ins->alu.outmod;
|
||||
|
||||
/* Type conversion is a sort of outmod */
|
||||
if (ins->alu.dest_override != midgard_dest_override_none)
|
||||
return true;
|
||||
|
||||
if (is_int)
|
||||
return mod != midgard_outmod_int_wrap;
|
||||
else
|
||||
return mod != midgard_outmod_none;
|
||||
}
|
||||
|
||||
/* Checks if an index will be used as a special register -- basically, if we're
|
||||
* used as the input to a non-ALU op */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue