+bool EmitAluInstruction::emit_mov(const nir_alu_instr& instr)
+{
+ /* If the op is a plain move beween SSA values we can just forward
+ * the register reference to the original register */
+ if (instr.dest.dest.is_ssa && instr.src[0].src.is_ssa &&
+ !instr.src[0].abs && !instr.src[0].negate && !instr.dest.saturate) {
+ bool result = true;
+ for (int i = 0; i < 4 ; ++i) {
+ if (instr.dest.write_mask & (1 << i)){
+ auto src = from_nir(instr.src[0], i);
+ result &= inject_register(instr.dest.dest.ssa.index, i,
+ src, true);
+
+ if (src->type() == Value::kconst) {
+ add_uniform((instr.dest.dest.ssa.index << 2) + i, src);
+ }
+ }
+ }
+ return result;
+ } else {
+ return emit_alu_op1(instr, op1_mov);
+ }
+}
+