ir_to_mesa: Add support for assignment of aggregates.

This commit is contained in:
Eric Anholt
2010-07-07 16:10:04 -07:00
parent 9b68b88e43
commit 7d8091f7cc

View File

@@ -1268,6 +1268,7 @@ ir_to_mesa_visitor::visit(ir_assignment *ir)
{ {
struct ir_to_mesa_dst_reg l; struct ir_to_mesa_dst_reg l;
struct ir_to_mesa_src_reg r; struct ir_to_mesa_src_reg r;
int i;
assert(!ir->lhs->type->is_matrix()); assert(!ir->lhs->type->is_matrix());
assert(!ir->lhs->type->is_array()); assert(!ir->lhs->type->is_array());
@@ -1295,10 +1296,18 @@ ir_to_mesa_visitor::visit(ir_assignment *ir)
* an extra computing the condition. * an extra computing the condition.
*/ */
condition.negate = ~condition.negate; condition.negate = ~condition.negate;
for (i = 0; i < type_size(ir->lhs->type); i++) {
ir_to_mesa_emit_op3(ir, OPCODE_CMP, l, ir_to_mesa_emit_op3(ir, OPCODE_CMP, l,
condition, r, ir_to_mesa_src_reg_from_dst(l)); condition, r, ir_to_mesa_src_reg_from_dst(l));
l.index++;
r.index++;
}
} else { } else {
for (i = 0; i < type_size(ir->lhs->type); i++) {
ir_to_mesa_emit_op1(ir, OPCODE_MOV, l, r); ir_to_mesa_emit_op1(ir, OPCODE_MOV, l, r);
l.index++;
r.index++;
}
} }
} }