void mir_print_bundle(midgard_bundle *ctx);
void mir_print_block(midgard_block *block);
void mir_print_shader(compiler_context *ctx);
+bool mir_nontrivial_raw_mod(midgard_vector_alu_src src, bool is_int);
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);
/* We don't know how to handle these with a constant */
- if (src->mod || src->half || src->rep_low || src->rep_high) {
+ bool is_int = midgard_is_integer_op(ins->alu.op);
+ if (mir_nontrivial_raw_mod(*src, is_int) || src->half || src->rep_low || src->rep_high) {
DBG("Bailing inline constant...\n");
continue;
}
}
bool
-mir_nontrivial_mod(midgard_vector_alu_src src, bool is_int, unsigned mask)
+mir_nontrivial_raw_mod(midgard_vector_alu_src src, bool is_int)
{
- /* abs or neg */
- if (!is_int && src.mod) return true;
+ if (is_int)
+ return src.mod == midgard_int_shift;
+ else
+ return src.mod;
+}
- /* Other int mods don't matter in isolation */
- if (is_int && src.mod == midgard_int_shift) return true;
+bool
+mir_nontrivial_mod(midgard_vector_alu_src src, bool is_int, unsigned mask)
+{
+ if (mir_nontrivial_raw_mod(src, is_int)) return true;
/* size-conversion */
if (src.half) return true;
return false;
}
-
bool
mir_nontrivial_source2_mod(midgard_instruction *ins)
{