nir_ssa_def *shift_ssa;
nir_ssa_def *new_offset = NULL;
- b->cursor = nir_after_instr(&alu->instr);
-
/* the first src could be something like ssa_18.x, but we only want
* the single component. Otherwise the ishl/ishr/ushr could turn
* into a vec4 operation:
nir_intrinsic_instr *new_intrinsic;
nir_src *target_src;
+ b->cursor = nir_before_instr(&intrinsic->instr);
+
/* 'offset_src_idx' holds the index of the source that represent the offset. */
new_intrinsic =
nir_intrinsic_instr_create(b->shader, ir3_ssbo_opcode);
new_intrinsic->num_components = intrinsic->num_components;
- b->cursor = nir_before_instr(&intrinsic->instr);
-
/* If we managed to propagate the division by 4, just use the new offset
* register and don't emit the SHR.
*/