nir/lower_to_source_mods: Stop turning add, sat, and neg into mov
[mesa.git] / src / compiler / nir / nir_validate.c
index b087b0da12deb2a0167bfe18b1403f46fa7ea772..30c4a9f5c6256dc1fbf69a8276b98fb5a1f05029 100644 (file)
@@ -217,6 +217,9 @@ validate_alu_src(nir_alu_instr *instr, unsigned index, validate_state *state)
 {
    nir_alu_src *src = &instr->src[index];
 
+   if (instr->op == nir_op_fmov || instr->op == nir_op_imov)
+      assert(!src->abs && !src->negate);
+
    unsigned num_components = nir_src_num_components(src->src);
    for (unsigned i = 0; i < NIR_MAX_VEC_COMPONENTS; i++) {
       validate_assert(state, src->swizzle[i] < NIR_MAX_VEC_COMPONENTS);
@@ -319,6 +322,9 @@ validate_alu_dest(nir_alu_instr *instr, validate_state *state)
 {
    nir_alu_dest *dest = &instr->dest;
 
+   if (instr->op == nir_op_fmov || instr->op == nir_op_imov)
+      assert(!dest->saturate);
+
    unsigned dest_size = nir_dest_num_components(dest->dest);
    /*
     * validate that the instruction doesn't write to components not in the