glsl: Add ir_quadop_vector expression

The vector operator collects 2, 3, or 4 scalar components into a
vector.  Doing this has several advantages.  First, it will make
ud-chain tracking for components of vectors much easier.  Second, a
later optimization pass could collect scalars into vectors to allow
generation of SWZ instructions (or similar as operands to other
instructions on R200 and i915).  It also enables an easy way to
generate IR for SWZ instructions in the ARB_vertex_program assembler.
This commit is contained in:
Ian Romanick
2010-11-16 12:01:42 -08:00
parent 13f57d42b6
commit 11d6f1c698
11 changed files with 460 additions and 6 deletions

View File

@@ -168,7 +168,8 @@ ir_expression::clone(void *mem_ctx, struct hash_table *ht) const
op[i] = this->operands[i]->clone(mem_ctx, ht);
}
return new(mem_ctx) ir_expression(this->operation, this->type, op[0], op[1]);
return new(mem_ctx) ir_expression(this->operation, this->type,
op[0], op[1], op[2], op[3]);
}
ir_dereference_variable *