/* Use this in conjunction with `type` */
unsigned op;
+ /* This refers to midgard_outmod_float or midgard_outmod_int.
+ * In case of a ALU op, use midgard_is_integer_out_op() to know which
+ * one is used.
+ * If it's a texture op, it's always midgard_outmod_float. */
+ unsigned outmod;
+
union {
midgard_load_store_word load_store;
midgard_vector_alu alu;
.dest = dest,
.dest_type = nir_type_uint32,
.op = midgard_alu_op_imov,
- .alu = {
- .outmod = midgard_outmod_int_wrap
- },
+ .outmod = midgard_outmod_int_wrap
};
return ins;
ins.mask = mask_of(nr_components);
- midgard_vector_alu alu = {
- .outmod = outmod,
- };
-
/* Apply writemask if non-SSA, keeping in mind that we can't write to
* components that don't exist. Note modifier => SSA => !reg => no
* writemask, so we don't have to worry about writemasks here.*/
if (!is_ssa)
ins.mask &= instr->dest.write_mask;
- ins.alu = alu;
-
ins.op = op;
+ ins.outmod = outmod;
/* Late fixup for emulated instructions */
{
midgard_vector_alu alu = ins->alu;
alu.op = ins->op;
+ alu.outmod = ins->outmod;
alu.reg_mode = reg_mode_for_bitsize(max_bitsize_for_alu(ins));
return alu;
}
ins->texture.out_upper = override > 0;
ins->texture.in_reg_full = (isz == 32);
ins->texture.sampler_type = midgard_sampler_type(ins->dest_type);
+ ins->texture.outmod = ins->outmod;
if (mir_op_computes_derivatives(ctx->stage, ins->texture.op)) {
ins->texture.cont = !ins->helper_terminate;
mir_nontrivial_outmod(midgard_instruction *ins)
{
bool is_int = midgard_is_integer_op(ins->op);
- unsigned mod = ins->alu.outmod;
+ unsigned mod = ins->outmod;
if (ins->dest_type != ins->src_types[1])
return true;