Browse Source

i965: Call insert and remove functions from exec_node directly.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
tags/10.4-branchpoint
Matt Turner 11 years ago
parent
commit
444fc0b4a8

+ 8
- 8
src/mesa/drivers/dri/i965/brw_cfg.cpp View File



switch (inst->opcode) { switch (inst->opcode) {
case BRW_OPCODE_IF: case BRW_OPCODE_IF:
inst->remove();
inst->exec_node::remove();
cur->instructions.push_tail(inst); cur->instructions.push_tail(inst);


/* Push our information onto a stack so we can recover from /* Push our information onto a stack so we can recover from
break; break;


case BRW_OPCODE_ELSE: case BRW_OPCODE_ELSE:
inst->remove();
inst->exec_node::remove();
cur->instructions.push_tail(inst); cur->instructions.push_tail(inst);


cur_else = cur; cur_else = cur;
set_next_block(&cur, cur_endif, ip - 1); set_next_block(&cur, cur_endif, ip - 1);
} }


inst->remove();
inst->exec_node::remove();
cur->instructions.push_tail(inst); cur->instructions.push_tail(inst);


if (cur_else) { if (cur_else) {
set_next_block(&cur, cur_do, ip - 1); set_next_block(&cur, cur_do, ip - 1);
} }


inst->remove();
inst->exec_node::remove();
cur->instructions.push_tail(inst); cur->instructions.push_tail(inst);
break; break;


case BRW_OPCODE_CONTINUE: case BRW_OPCODE_CONTINUE:
inst->remove();
inst->exec_node::remove();
cur->instructions.push_tail(inst); cur->instructions.push_tail(inst);


cur->add_successor(mem_ctx, cur_do); cur->add_successor(mem_ctx, cur_do);
break; break;


case BRW_OPCODE_BREAK: case BRW_OPCODE_BREAK:
inst->remove();
inst->exec_node::remove();
cur->instructions.push_tail(inst); cur->instructions.push_tail(inst);


cur->add_successor(mem_ctx, cur_while); cur->add_successor(mem_ctx, cur_while);
break; break;


case BRW_OPCODE_WHILE: case BRW_OPCODE_WHILE:
inst->remove();
inst->exec_node::remove();
cur->instructions.push_tail(inst); cur->instructions.push_tail(inst);


cur->add_successor(mem_ctx, cur_do); cur->add_successor(mem_ctx, cur_do);
break; break;


default: default:
inst->remove();
inst->exec_node::remove();
cur->instructions.push_tail(inst); cur->instructions.push_tail(inst);
break; break;
} }

+ 3
- 3
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp View File



/* Remove the matched instructions; we'll emit a SEL to replace them. */ /* Remove the matched instructions; we'll emit a SEL to replace them. */
while (!if_inst->next->is_tail_sentinel()) while (!if_inst->next->is_tail_sentinel())
if_inst->next->remove();
if_inst->remove();
if_inst->next->exec_node::remove();
if_inst->exec_node::remove();


/* Only the last source register can be a constant, so if the MOV in /* Only the last source register can be a constant, so if the MOV in
* the "then" clause uses a constant, we need to put it in a temporary. * the "then" clause uses a constant, we need to put it in a temporary.
fs_visitor::emit(exec_list list) fs_visitor::emit(exec_list list)
{ {
foreach_in_list_safe(fs_inst, inst, &list) { foreach_in_list_safe(fs_inst, inst, &list) {
inst->remove();
inst->exec_node::remove();
emit(inst); emit(inst);
} }
} }

+ 0
- 3
src/mesa/drivers/dri/i965/brw_shader.h View File

bool reads_accumulator_implicitly() const; bool reads_accumulator_implicitly() const;
bool writes_accumulator_implicitly(struct brw_context *brw) const; bool writes_accumulator_implicitly(struct brw_context *brw) const;


using exec_node::remove;
void remove(bblock_t *block); void remove(bblock_t *block);
using exec_node::insert_after;
void insert_after(bblock_t *block, backend_instruction *inst); void insert_after(bblock_t *block, backend_instruction *inst);
using exec_node::insert_before;
void insert_before(bblock_t *block, backend_instruction *inst); void insert_before(bblock_t *block, backend_instruction *inst);
void insert_before(bblock_t *block, exec_list *list); void insert_before(bblock_t *block, exec_list *list);



Loading…
Cancel
Save