+ /* Save op0 */ + ir_variable *temp = new(ir) ir_variable(ir->operands[0]-> type, "bfi_base", + ir_var_temporary); + this->base_ir->insert_before(temp); + this->base_ir->insert_before(assign(temp, ir->operands[0])); + + ir->operation = ir_triop_bfi; + ir->operands[0] = new(ir) ir_expression(ir_binop_bfm, ir->type, + swizzle_xxxx(ir->operands[3]), + swizzle_xxxx(ir->operands[2])); + /* ir->operands[1] is still the value to insert. */ + ir->operands[2] = new(ir) ir_dereference_variable(temp); + ir->operands[3] = NULL;
Emitting the temp and assignment to it into the IR seems spurious -- is there a reason something like this doesn't work:? ir_rvalue *base_expr = ir->operands[0]; ir->operation = ir_triop_bfi; ir->operands[0] = new(ir) ir_expression(ir_binop_bfm, ir-type, swizzle_xxxx(ir->operands[3]), swizzle_xxxx(ir->operands[2])); /* ir->operands[1] is still the value to insert. */ ir->operands[2] = base_expr; ir->operands[3] = NULL; I might have missed something :) -- Chris _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev