bool writeout;
bool prepacked_branch;
+ /* Kind of a hack, but hint against aggressive DCE */
+ bool dont_eliminate;
+
/* Masks in a saneish format. One bit per channel, not packed fancy.
* Use this instead of the op specific ones, and switch over at emit
* time */
bool invert;
+ /* Hint for the register allocator not to spill the destination written
+ * from this instruction (because it is a spill/unspill node itself) */
+
+ bool no_spill;
+
+ /* Generic hint for intra-pass use */
+ bool hint;
+
union {
midgard_load_store_word load_store;
midgard_vector_alu alu;
/* Succeeding blocks. The compiler should not necessarily rely on
* source-order traversal */
- struct midgard_block *successors[4];
+ struct midgard_block *successors[2];
unsigned nr_successors;
/* The successors pointer form a graph, and in the case of
/* Alpha ref value passed in */
float alpha_ref;
- /* The index corresponding to the fragment output */
- unsigned fragment_output;
-
/* The mapping of sysvals to uniforms, the count, and the off-by-one inverse */
unsigned sysvals[MAX_SYSVAL_COUNT];
unsigned sysval_count;
return heap;
}
-static inline void
+static inline midgard_instruction *
emit_mir_instruction(struct compiler_context *ctx, struct midgard_instruction ins)
{
- list_addtail(&(mir_upload_ins(ins))->link, &ctx->current_block->instructions);
+ midgard_instruction *u = mir_upload_ins(ins);
+ list_addtail(&u->link, &ctx->current_block->instructions);
+ return u;
}
static inline struct midgard_instruction *
unsigned mir_use_count(compiler_context *ctx, unsigned value);
bool mir_is_written_before(compiler_context *ctx, midgard_instruction *ins, unsigned node);
unsigned mir_mask_of_read_components(midgard_instruction *ins, unsigned node);
+unsigned mir_ubo_shift(midgard_load_store_op op);
/* MIR printing */
void mir_create_pipeline_registers(compiler_context *ctx);
void
-midgard_promote_uniforms(compiler_context *ctx, unsigned pressure);
+midgard_promote_uniforms(compiler_context *ctx, unsigned promoted_count);
-void
+midgard_instruction *
emit_ubo_read(
compiler_context *ctx,
+ nir_instr *instr,
unsigned dest,
unsigned offset,
nir_src *indirect_offset,
unsigned index);
+void
+emit_sysval_read(compiler_context *ctx, nir_instr *instr, signed dest_override, unsigned nr_components);
+
void
midgard_emit_derivatives(compiler_context *ctx, nir_alu_instr *instr);