const brw_blorp_blit_prog_key *key);
const GLuint *compile(struct brw_context *brw, GLuint *program_size,
- FILE *dump_file = stdout);
+ FILE *dump_file = stderr);
brw_blorp_prog_data prog_data;
&prog_offset, prog_data)) {
brw_blorp_blit_program prog(brw, &this->wm_prog_key);
GLuint program_size;
- const GLuint *program = prog.compile(brw, &program_size, stdout);
+ const GLuint *program = prog.compile(brw, &program_size, stderr);
brw_upload_cache(&brw->cache, BRW_BLORP_BLIT_PROG,
&this->wm_prog_key, sizeof(this->wm_prog_key),
program, program_size,
const unsigned *res;
if (unlikely(INTEL_DEBUG & DEBUG_BLORP)) {
- printf("Native code for BLORP blit:\n");
+ fprintf(stderr, "Native code for BLORP blit:\n");
res = generator.generate_assembly(NULL, &insts, program_size, dump_file);
- printf("\n");
+ fprintf(stderr, "\n");
} else {
res = generator.generate_assembly(NULL, &insts, program_size);
}
false /* header present */);
if (unlikely(INTEL_DEBUG & DEBUG_BLORP)) {
- printf("Native code for BLORP clear:\n");
- brw_dump_compile(&func, stdout, 0, func.next_insn_offset);
- printf("\n");
+ fprintf(stderr, "Native code for BLORP clear:\n");
+ brw_dump_compile(&func, stderr, 0, func.next_insn_offset);
+ fprintf(stderr, "\n");
}
return brw_get_program(&func, program_size);
}
for (backend_instruction *inst = (backend_instruction *)this->start;
inst != this->end->next;
inst = (backend_instruction *) inst->next) {
- printf("%5d: ", ip);
+ fprintf(stderr, "%5d: ", ip);
v->dump_instruction(inst);
ip++;
}
{
for (int b = 0; b < this->num_blocks; b++) {
bblock_t *block = this->blocks[b];
- printf("START B%d", b);
+ fprintf(stderr, "START B%d", b);
foreach_list(node, &block->parents) {
bblock_link *link = (bblock_link *)node;
- printf(" <-B%d", link->block->block_num);
+ fprintf(stderr, " <-B%d",
+ link->block->block_num);
}
- printf("\n");
+ fprintf(stderr, "\n");
block->dump(v);
- printf("END B%d", b);
+ fprintf(stderr, "END B%d", b);
foreach_list(node, &block->children) {
bblock_link *link = (bblock_link *)node;
- printf(" ->B%d", link->block->block_num);
+ fprintf(stderr, " ->B%d",
+ link->block->block_num);
}
- printf("\n");
+ fprintf(stderr, "\n");
}
}
program = brw_get_program(&c.func, &program_size);
if (unlikely(INTEL_DEBUG & DEBUG_CLIP)) {
- printf("clip:\n");
+ fprintf(stderr, "clip:\n");
for (i = 0; i < program_size / sizeof(struct brw_instruction); i++)
- brw_disasm(stdout, &((struct brw_instruction *)program)[i],
+ brw_disasm(stderr, &((struct brw_instruction *)program)[i],
brw->gen);
- printf("\n");
+ fprintf(stderr, "\n");
}
brw_upload_cache(&brw->cache,
p->nr_insn = p->next_insn_offset / 16;
if (0) {
- fprintf(stdout, "dumping compacted program\n");
- brw_dump_compile(p, stdout, 0, p->next_insn_offset);
+ fprintf(stderr, "dumping compacted program\n");
+ brw_dump_compile(p, stderr, 0, p->next_insn_offset);
int cmp = 0;
for (offset = 0; offset < p->next_insn_offset;) {
foreach_list(node, &this->instructions) {
backend_instruction *inst = (backend_instruction *)node;
max_pressure = MAX2(max_pressure, regs_live_at_ip[ip]);
- printf("{%3d} %4d: ", regs_live_at_ip[ip], ip);
+ fprintf(stderr, "{%3d} %4d: ", regs_live_at_ip[ip], ip);
dump_instruction(inst);
++ip;
}
- printf("Maximum %3d registers live at once.\n", max_pressure);
+ fprintf(stderr, "Maximum %3d registers live at once.\n", max_pressure);
}
void
fs_inst *inst = (fs_inst *)be_inst;
if (inst->predicate) {
- printf("(%cf0.%d) ",
+ fprintf(stderr, "(%cf0.%d) ",
inst->predicate_inverse ? '-' : '+',
inst->flag_subreg);
}
- printf("%s", brw_instruction_name(inst->opcode));
+ fprintf(stderr, "%s", brw_instruction_name(inst->opcode));
if (inst->saturate)
- printf(".sat");
+ fprintf(stderr, ".sat");
if (inst->conditional_mod) {
- printf("%s", conditional_modifier[inst->conditional_mod]);
+ fprintf(stderr, "%s", conditional_modifier[inst->conditional_mod]);
if (!inst->predicate &&
(brw->gen < 5 || (inst->opcode != BRW_OPCODE_SEL &&
inst->opcode != BRW_OPCODE_IF &&
inst->opcode != BRW_OPCODE_WHILE))) {
- printf(".f0.%d", inst->flag_subreg);
+ fprintf(stderr, ".f0.%d", inst->flag_subreg);
}
}
- printf(" ");
+ fprintf(stderr, " ");
switch (inst->dst.file) {
case GRF:
- printf("vgrf%d", inst->dst.reg);
+ fprintf(stderr, "vgrf%d", inst->dst.reg);
if (virtual_grf_sizes[inst->dst.reg] != 1 ||
inst->dst.subreg_offset)
- printf("+%d.%d", inst->dst.reg_offset, inst->dst.subreg_offset);
+ fprintf(stderr, "+%d.%d",
+ inst->dst.reg_offset, inst->dst.subreg_offset);
break;
case MRF:
- printf("m%d", inst->dst.reg);
+ fprintf(stderr, "m%d", inst->dst.reg);
break;
case BAD_FILE:
- printf("(null)");
+ fprintf(stderr, "(null)");
break;
case UNIFORM:
- printf("***u%d***", inst->dst.reg);
+ fprintf(stderr, "***u%d***", inst->dst.reg);
break;
case HW_REG:
if (inst->dst.fixed_hw_reg.file == BRW_ARCHITECTURE_REGISTER_FILE) {
switch (inst->dst.fixed_hw_reg.nr) {
case BRW_ARF_NULL:
- printf("null");
+ fprintf(stderr, "null");
break;
case BRW_ARF_ADDRESS:
- printf("a0.%d", inst->dst.fixed_hw_reg.subnr);
+ fprintf(stderr, "a0.%d", inst->dst.fixed_hw_reg.subnr);
break;
case BRW_ARF_ACCUMULATOR:
- printf("acc%d", inst->dst.fixed_hw_reg.subnr);
+ fprintf(stderr, "acc%d", inst->dst.fixed_hw_reg.subnr);
break;
case BRW_ARF_FLAG:
- printf("f%d.%d", inst->dst.fixed_hw_reg.nr & 0xf,
+ fprintf(stderr, "f%d.%d", inst->dst.fixed_hw_reg.nr & 0xf,
inst->dst.fixed_hw_reg.subnr);
break;
default:
- printf("arf%d.%d", inst->dst.fixed_hw_reg.nr & 0xf,
+ fprintf(stderr, "arf%d.%d", inst->dst.fixed_hw_reg.nr & 0xf,
inst->dst.fixed_hw_reg.subnr);
break;
}
} else {
- printf("hw_reg%d", inst->dst.fixed_hw_reg.nr);
+ fprintf(stderr, "hw_reg%d", inst->dst.fixed_hw_reg.nr);
}
if (inst->dst.fixed_hw_reg.subnr)
- printf("+%d", inst->dst.fixed_hw_reg.subnr);
+ fprintf(stderr, "+%d", inst->dst.fixed_hw_reg.subnr);
break;
default:
- printf("???");
+ fprintf(stderr, "???");
break;
}
- printf(":%s, ", reg_encoding[inst->dst.type]);
+ fprintf(stderr, ":%s, ", reg_encoding[inst->dst.type]);
for (int i = 0; i < 3 && inst->src[i].file != BAD_FILE; i++) {
if (inst->src[i].negate)
- printf("-");
+ fprintf(stderr, "-");
if (inst->src[i].abs)
- printf("|");
+ fprintf(stderr, "|");
switch (inst->src[i].file) {
case GRF:
- printf("vgrf%d", inst->src[i].reg);
+ fprintf(stderr, "vgrf%d", inst->src[i].reg);
if (virtual_grf_sizes[inst->src[i].reg] != 1 ||
inst->src[i].subreg_offset)
- printf("+%d.%d", inst->src[i].reg_offset,
- inst->src[i].subreg_offset);
+ fprintf(stderr, "+%d.%d", inst->src[i].reg_offset,
+ inst->src[i].subreg_offset);
break;
case MRF:
- printf("***m%d***", inst->src[i].reg);
+ fprintf(stderr, "***m%d***", inst->src[i].reg);
break;
case UNIFORM:
- printf("u%d", inst->src[i].reg);
+ fprintf(stderr, "u%d", inst->src[i].reg);
if (virtual_grf_sizes[inst->src[i].reg] != 1 ||
inst->src[i].subreg_offset)
- printf("+%d.%d", inst->src[i].reg_offset,
- inst->src[i].subreg_offset);
+ fprintf(stderr, "+%d.%d", inst->src[i].reg_offset,
+ inst->src[i].subreg_offset);
break;
case BAD_FILE:
- printf("(null)");
+ fprintf(stderr, "(null)");
break;
case IMM:
switch (inst->src[i].type) {
case BRW_REGISTER_TYPE_F:
- printf("%ff", inst->src[i].imm.f);
+ fprintf(stderr, "%ff", inst->src[i].imm.f);
break;
case BRW_REGISTER_TYPE_D:
- printf("%dd", inst->src[i].imm.i);
+ fprintf(stderr, "%dd", inst->src[i].imm.i);
break;
case BRW_REGISTER_TYPE_UD:
- printf("%uu", inst->src[i].imm.u);
+ fprintf(stderr, "%uu", inst->src[i].imm.u);
break;
default:
- printf("???");
+ fprintf(stderr, "???");
break;
}
break;
case HW_REG:
if (inst->src[i].fixed_hw_reg.negate)
- printf("-");
+ fprintf(stderr, "-");
if (inst->src[i].fixed_hw_reg.abs)
- printf("|");
+ fprintf(stderr, "|");
if (inst->src[i].fixed_hw_reg.file == BRW_ARCHITECTURE_REGISTER_FILE) {
switch (inst->src[i].fixed_hw_reg.nr) {
case BRW_ARF_NULL:
- printf("null");
+ fprintf(stderr, "null");
break;
case BRW_ARF_ADDRESS:
- printf("a0.%d", inst->src[i].fixed_hw_reg.subnr);
+ fprintf(stderr, "a0.%d", inst->src[i].fixed_hw_reg.subnr);
break;
case BRW_ARF_ACCUMULATOR:
- printf("acc%d", inst->src[i].fixed_hw_reg.subnr);
+ fprintf(stderr, "acc%d", inst->src[i].fixed_hw_reg.subnr);
break;
case BRW_ARF_FLAG:
- printf("f%d.%d", inst->src[i].fixed_hw_reg.nr & 0xf,
+ fprintf(stderr, "f%d.%d", inst->src[i].fixed_hw_reg.nr & 0xf,
inst->src[i].fixed_hw_reg.subnr);
break;
default:
- printf("arf%d.%d", inst->src[i].fixed_hw_reg.nr & 0xf,
+ fprintf(stderr, "arf%d.%d", inst->src[i].fixed_hw_reg.nr & 0xf,
inst->src[i].fixed_hw_reg.subnr);
break;
}
} else {
- printf("hw_reg%d", inst->src[i].fixed_hw_reg.nr);
+ fprintf(stderr, "hw_reg%d", inst->src[i].fixed_hw_reg.nr);
}
if (inst->src[i].fixed_hw_reg.subnr)
- printf("+%d", inst->src[i].fixed_hw_reg.subnr);
+ fprintf(stderr, "+%d", inst->src[i].fixed_hw_reg.subnr);
if (inst->src[i].fixed_hw_reg.abs)
- printf("|");
+ fprintf(stderr, "|");
break;
default:
- printf("???");
+ fprintf(stderr, "???");
break;
}
if (inst->src[i].abs)
- printf("|");
+ fprintf(stderr, "|");
if (inst->src[i].file != IMM) {
- printf(":%s", brw_reg_type_letters(inst->src[i].type));
+ fprintf(stderr, ":%s", brw_reg_type_letters(inst->src[i].type));
}
if (i < 2 && inst->src[i + 1].file != BAD_FILE)
- printf(", ");
+ fprintf(stderr, ", ");
}
- printf(" ");
+ fprintf(stderr, " ");
if (inst->force_uncompressed)
- printf("1sthalf ");
+ fprintf(stderr, "1sthalf ");
if (inst->force_sechalf)
- printf("2ndhalf ");
+ fprintf(stderr, "2ndhalf ");
- printf("\n");
+ fprintf(stderr, "\n");
}
/**
case ir_binop_logic_and:
case ir_binop_logic_xor:
case ir_binop_logic_or:
- ir->print();
- printf("\n");
+ ir->fprint(stderr);
+ fprintf(stderr, "\n");
assert(!"not reached: expression operates on scalars only");
break;
case ir_binop_all_equal:
{
for (int b = 0; b < cfg->num_blocks; b++) {
bblock_t *block = cfg->blocks[b];
- printf("Block %d [%d, %d] (parents ", block->block_num,
+ fprintf(stderr, "Block %d [%d, %d] (parents ", block->block_num,
block->start_ip, block->end_ip);
foreach_list(block_node, &block->parents) {
bblock_t *parent = ((bblock_link *) block_node)->block;
- printf("%d ", parent->block_num);
+ fprintf(stderr, "%d ", parent->block_num);
}
- printf("):\n");
- printf(" livein = 0x");
+ fprintf(stderr, "):\n");
+ fprintf(stderr, " livein = 0x");
for (int i = 0; i < bitset_words; i++)
- printf("%08x", bd[b].livein[i]);
- printf(", liveout = 0x");
+ fprintf(stderr, "%08x", bd[b].livein[i]);
+ fprintf(stderr, ", liveout = 0x");
for (int i = 0; i < bitset_words; i++)
- printf("%08x", bd[b].liveout[i]);
- printf(",\n copy = 0x");
+ fprintf(stderr, "%08x", bd[b].liveout[i]);
+ fprintf(stderr, ",\n copy = 0x");
for (int i = 0; i < bitset_words; i++)
- printf("%08x", bd[b].copy[i]);
- printf(", kill = 0x");
+ fprintf(stderr, "%08x", bd[b].copy[i]);
+ fprintf(stderr, ", kill = 0x");
for (int i = 0; i < bitset_words; i++)
- printf("%08x", bd[b].kill[i]);
- printf("\n");
+ fprintf(stderr, "%08x", bd[b].kill[i]);
+ fprintf(stderr, "\n");
}
}
if (unlikely(INTEL_DEBUG & DEBUG_WM)) {
if (prog) {
- printf("Native code for %s fragment shader %d (SIMD%d dispatch):\n",
- prog->Label ? prog->Label : "unnamed",
- prog->Name, dispatch_width);
+ fprintf(stderr,
+ "Native code for %s fragment shader %d (SIMD%d dispatch):\n",
+ prog->Label ? prog->Label : "unnamed",
+ prog->Name, dispatch_width);
} else if (fp) {
- printf("Native code for fragment program %d (SIMD%d dispatch):\n",
- fp->Base.Id, dispatch_width);
+ fprintf(stderr,
+ "Native code for fragment program %d (SIMD%d dispatch):\n",
+ fp->Base.Id, dispatch_width);
} else {
- printf("Native code for blorp program (SIMD%d dispatch):\n",
- dispatch_width);
+ fprintf(stderr, "Native code for blorp program (SIMD%d dispatch):\n",
+ dispatch_width);
}
}
bblock_t *block = link->block;
if (block->start == inst) {
- printf(" START B%d", block->block_num);
+ fprintf(stderr, " START B%d", block->block_num);
foreach_list(predecessor_node, &block->parents) {
bblock_link *predecessor_link =
(bblock_link *)predecessor_node;
bblock_t *predecessor_block = predecessor_link->block;
- printf(" <-B%d", predecessor_block->block_num);
+ fprintf(stderr, " <-B%d", predecessor_block->block_num);
}
- printf("\n");
+ fprintf(stderr, "\n");
}
}
if (last_annotation_ir != inst->ir) {
last_annotation_ir = inst->ir;
if (last_annotation_ir) {
- printf(" ");
+ fprintf(stderr, " ");
if (prog)
- ((ir_instruction *)inst->ir)->print();
+ ((ir_instruction *)inst->ir)->fprint(stderr);
else {
const prog_instruction *fpi;
fpi = (const prog_instruction *)inst->ir;
- printf("%d: ", (int)(fpi - (fp ? fp->Base.Instructions : 0)));
- _mesa_fprint_instruction_opt(stdout,
+ fprintf(stderr, "%d: ",
+ (int)(fpi - (fp ? fp->Base.Instructions : 0)));
+ _mesa_fprint_instruction_opt(stderr,
fpi,
0, PROG_PRINT_DEBUG, NULL);
}
- printf("\n");
+ fprintf(stderr, "\n");
}
}
if (last_annotation_string != inst->annotation) {
last_annotation_string = inst->annotation;
if (last_annotation_string)
- printf(" %s\n", last_annotation_string);
+ fprintf(stderr, " %s\n", last_annotation_string);
}
}
}
if (unlikely(INTEL_DEBUG & DEBUG_WM)) {
- brw_dump_compile(p, stdout,
+ brw_dump_compile(p, stderr,
last_native_insn_offset, p->next_insn_offset);
foreach_list(node, &cfg->block_list) {
bblock_t *block = link->block;
if (block->end == inst) {
- printf(" END B%d", block->block_num);
+ fprintf(stderr, " END B%d", block->block_num);
foreach_list(successor_node, &block->children) {
bblock_link *successor_link =
(bblock_link *)successor_node;
bblock_t *successor_block = successor_link->block;
- printf(" ->B%d", successor_block->block_num);
+ fprintf(stderr, " ->B%d", successor_block->block_num);
}
- printf("\n");
+ fprintf(stderr, "\n");
}
}
}
}
if (unlikely(INTEL_DEBUG & DEBUG_WM)) {
- printf("\n");
+ fprintf(stderr, "\n");
}
brw_set_uip_jip(p);
elem = 3;
break;
default:
- ir->print();
+ ir->fprint(stderr);
assert(!"not reached: non-channelwise dereference of LHS.");
}
variable_entry *entry = (variable_entry *)node;
if (debug) {
- printf("vector %s@%p: decl %d, whole_access %d\n",
- entry->var->name, (void *) entry->var, entry->declaration,
- entry->whole_vector_access);
+ fprintf(stderr, "vector %s@%p: decl %d, whole_access %d\n",
+ entry->var->name, (void *) entry->var, entry->declaration,
+ entry->whole_vector_access);
}
if (!entry->declaration || entry->whole_vector_access) {
ir->operands[operand]->accept(this);
if (this->result.file == BAD_FILE) {
fail("Failed to get tree for expression operand:\n");
- ir->operands[operand]->print();
- printf("\n");
+ ir->operands[operand]->fprint(stderr);
+ fprintf(stderr, "\n");
}
assert(this->result.is_valid_3src());
op[operand] = this->result;
if (unlikely(INTEL_DEBUG & DEBUG_GS)) {
int i;
- printf("gs:\n");
+ fprintf(stderr, "gs:\n");
for (i = 0; i < program_size / sizeof(struct brw_instruction); i++)
- brw_disasm(stdout, &((struct brw_instruction *)program)[i],
+ brw_disasm(stderr, &((struct brw_instruction *)program)[i],
brw->gen);
- printf("\n");
+ fprintf(stderr, "\n");
}
brw_upload_cache(&brw->cache, BRW_FF_GS_PROG,
struct gl_shader *shader, struct gl_program *prog)
{
if (shader_prog) {
- printf("GLSL IR for native %s shader %d:\n", stage, shader_prog->Name);
- _mesa_print_ir(stdout, shader->ir, NULL);
- printf("\n\n");
+ fprintf(stderr,
+ "GLSL IR for native %s shader %d:\n", stage, shader_prog->Name);
+ _mesa_print_ir(stderr, shader->ir, NULL);
+ fprintf(stderr, "\n\n");
} else {
- printf("ARB_%s_program %d ir for native %s shader\n",
- stage, prog->Id, stage);
+ fprintf(stderr, "ARB_%s_program %d ir for native %s shader\n",
+ stage, prog->Id, stage);
_mesa_print_program(prog);
}
}
time = MAX2(time, chosen->unblocked_time);
if (debug) {
- printf("clock %4d, scheduled: ", time);
+ fprintf(stderr, "clock %4d, scheduled: ", time);
bv->dump_instruction(chosen->inst);
}
time + chosen->child_latency[i]);
if (debug) {
- printf("\tchild %d, %d parents: ", i, child->parent_count);
+ fprintf(stderr, "\tchild %d, %d parents: ", i, child->parent_count);
bv->dump_instruction(child->inst);
}
child->parent_count--;
if (child->parent_count == 0) {
if (debug) {
- printf("\t\tnow available\n");
+ fprintf(stderr, "\t\tnow available\n");
}
instructions.push_head(child);
}
(backend_instruction *)all_instructions->head;
if (debug) {
- printf("\nInstructions before scheduling (reg_alloc %d)\n", post_reg_alloc);
+ fprintf(stderr, "\nInstructions before scheduling (reg_alloc %d)\n",
+ post_reg_alloc);
bv->dump_instructions();
}
}
if (debug) {
- printf("\nInstructions after scheduling (reg_alloc %d)\n", post_reg_alloc);
+ fprintf(stderr, "\nInstructions after scheduling (reg_alloc %d)\n",
+ post_reg_alloc);
bv->dump_instructions();
}
}
sched.run(&instructions);
if (unlikely(INTEL_DEBUG & DEBUG_WM) && mode == SCHEDULE_POST) {
- printf("fs%d estimated execution time: %d cycles\n",
+ fprintf(stderr, "fs%d estimated execution time: %d cycles\n",
dispatch_width, sched.time);
}
sched.run(&instructions);
if (unlikely(debug_flag)) {
- printf("vec4 estimated execution time: %d cycles\n", sched.time);
+ fprintf(stderr, "vec4 estimated execution time: %d cycles\n", sched.time);
}
invalidate_live_intervals();
program = brw_get_program(&c.func, &program_size);
if (unlikely(INTEL_DEBUG & DEBUG_SF)) {
- printf("sf:\n");
+ fprintf(stderr, "sf:\n");
for (i = 0; i < program_size / sizeof(struct brw_instruction); i++)
- brw_disasm(stdout, &((struct brw_instruction *)program)[i],
+ brw_disasm(stderr, &((struct brw_instruction *)program)[i],
brw->gen);
- printf("\n");
+ fprintf(stderr, "\n");
}
brw_upload_cache(&brw->cache, BRW_SF_PROG,
_mesa_reference_program(ctx, &prog, NULL);
if (ctx->Shader.Flags & GLSL_DUMP) {
- printf("\n");
- printf("GLSL IR for linked %s program %d:\n",
- _mesa_shader_stage_to_string(shader->base.Stage),
- shProg->Name);
- _mesa_print_ir(stdout, shader->base.ir, NULL);
- printf("\n");
+ fprintf(stderr, "\n");
+ fprintf(stderr, "GLSL IR for linked %s program %d:\n",
+ _mesa_shader_stage_to_string(shader->base.Stage),
+ shProg->Name);
+ _mesa_print_ir(stderr, shader->base.ir, NULL);
+ fprintf(stderr, "\n");
}
}
if (!sh)
continue;
- printf("GLSL %s shader %d source for linked program %d:\n",
- _mesa_shader_stage_to_string(sh->Stage),
- i,
- shProg->Name);
- printf("%s", sh->Source);
- printf("\n");
+ fprintf(stderr, "GLSL %s shader %d source for linked program %d:\n",
+ _mesa_shader_stage_to_string(sh->Stage),
+ i, shProg->Name);
+ fprintf(stderr, "%s", sh->Source);
+ fprintf(stderr, "\n");
}
}
int ip = 0;
foreach_list(node, &this->instructions) {
backend_instruction *inst = (backend_instruction *)node;
- printf("%d: ", ip++);
+ fprintf(stderr, "%d: ", ip++);
dump_instruction(inst);
}
}
{
vec4_instruction *inst = (vec4_instruction *)be_inst;
- printf("%s", brw_instruction_name(inst->opcode));
+ fprintf(stderr, "%s", brw_instruction_name(inst->opcode));
if (inst->conditional_mod) {
- printf("%s", conditional_modifier[inst->conditional_mod]);
+ fprintf(stderr, "%s", conditional_modifier[inst->conditional_mod]);
}
- printf(" ");
+ fprintf(stderr, " ");
switch (inst->dst.file) {
case GRF:
- printf("vgrf%d.%d", inst->dst.reg, inst->dst.reg_offset);
+ fprintf(stderr, "vgrf%d.%d", inst->dst.reg, inst->dst.reg_offset);
break;
case MRF:
- printf("m%d", inst->dst.reg);
+ fprintf(stderr, "m%d", inst->dst.reg);
break;
case HW_REG:
if (inst->dst.fixed_hw_reg.file == BRW_ARCHITECTURE_REGISTER_FILE) {
switch (inst->dst.fixed_hw_reg.nr) {
case BRW_ARF_NULL:
- printf("null");
+ fprintf(stderr, "null");
break;
case BRW_ARF_ADDRESS:
- printf("a0.%d", inst->dst.fixed_hw_reg.subnr);
+ fprintf(stderr, "a0.%d", inst->dst.fixed_hw_reg.subnr);
break;
case BRW_ARF_ACCUMULATOR:
- printf("acc%d", inst->dst.fixed_hw_reg.subnr);
+ fprintf(stderr, "acc%d", inst->dst.fixed_hw_reg.subnr);
break;
case BRW_ARF_FLAG:
- printf("f%d.%d", inst->dst.fixed_hw_reg.nr & 0xf,
+ fprintf(stderr, "f%d.%d", inst->dst.fixed_hw_reg.nr & 0xf,
inst->dst.fixed_hw_reg.subnr);
break;
default:
- printf("arf%d.%d", inst->dst.fixed_hw_reg.nr & 0xf,
+ fprintf(stderr, "arf%d.%d", inst->dst.fixed_hw_reg.nr & 0xf,
inst->dst.fixed_hw_reg.subnr);
break;
}
} else {
- printf("hw_reg%d", inst->dst.fixed_hw_reg.nr);
+ fprintf(stderr, "hw_reg%d", inst->dst.fixed_hw_reg.nr);
}
if (inst->dst.fixed_hw_reg.subnr)
- printf("+%d", inst->dst.fixed_hw_reg.subnr);
+ fprintf(stderr, "+%d", inst->dst.fixed_hw_reg.subnr);
break;
case BAD_FILE:
- printf("(null)");
+ fprintf(stderr, "(null)");
break;
default:
- printf("???");
+ fprintf(stderr, "???");
break;
}
if (inst->dst.writemask != WRITEMASK_XYZW) {
- printf(".");
+ fprintf(stderr, ".");
if (inst->dst.writemask & 1)
- printf("x");
+ fprintf(stderr, "x");
if (inst->dst.writemask & 2)
- printf("y");
+ fprintf(stderr, "y");
if (inst->dst.writemask & 4)
- printf("z");
+ fprintf(stderr, "z");
if (inst->dst.writemask & 8)
- printf("w");
+ fprintf(stderr, "w");
}
- printf(":%s, ", brw_reg_type_letters(inst->dst.type));
+ fprintf(stderr, ":%s, ", brw_reg_type_letters(inst->dst.type));
for (int i = 0; i < 3 && inst->src[i].file != BAD_FILE; i++) {
if (inst->src[i].negate)
- printf("-");
+ fprintf(stderr, "-");
if (inst->src[i].abs)
- printf("|");
+ fprintf(stderr, "|");
switch (inst->src[i].file) {
case GRF:
- printf("vgrf%d", inst->src[i].reg);
+ fprintf(stderr, "vgrf%d", inst->src[i].reg);
break;
case ATTR:
- printf("attr%d", inst->src[i].reg);
+ fprintf(stderr, "attr%d", inst->src[i].reg);
break;
case UNIFORM:
- printf("u%d", inst->src[i].reg);
+ fprintf(stderr, "u%d", inst->src[i].reg);
break;
case IMM:
switch (inst->src[i].type) {
case BRW_REGISTER_TYPE_F:
- printf("%fF", inst->src[i].imm.f);
+ fprintf(stderr, "%fF", inst->src[i].imm.f);
break;
case BRW_REGISTER_TYPE_D:
- printf("%dD", inst->src[i].imm.i);
+ fprintf(stderr, "%dD", inst->src[i].imm.i);
break;
case BRW_REGISTER_TYPE_UD:
- printf("%uU", inst->src[i].imm.u);
+ fprintf(stderr, "%uU", inst->src[i].imm.u);
break;
default:
- printf("???");
+ fprintf(stderr, "???");
break;
}
break;
case HW_REG:
if (inst->src[i].fixed_hw_reg.negate)
- printf("-");
+ fprintf(stderr, "-");
if (inst->src[i].fixed_hw_reg.abs)
- printf("|");
+ fprintf(stderr, "|");
if (inst->src[i].fixed_hw_reg.file == BRW_ARCHITECTURE_REGISTER_FILE) {
switch (inst->src[i].fixed_hw_reg.nr) {
case BRW_ARF_NULL:
- printf("null");
+ fprintf(stderr, "null");
break;
case BRW_ARF_ADDRESS:
- printf("a0.%d", inst->src[i].fixed_hw_reg.subnr);
+ fprintf(stderr, "a0.%d", inst->src[i].fixed_hw_reg.subnr);
break;
case BRW_ARF_ACCUMULATOR:
- printf("acc%d", inst->src[i].fixed_hw_reg.subnr);
+ fprintf(stderr, "acc%d", inst->src[i].fixed_hw_reg.subnr);
break;
case BRW_ARF_FLAG:
- printf("f%d.%d", inst->src[i].fixed_hw_reg.nr & 0xf,
+ fprintf(stderr, "f%d.%d", inst->src[i].fixed_hw_reg.nr & 0xf,
inst->src[i].fixed_hw_reg.subnr);
break;
default:
- printf("arf%d.%d", inst->src[i].fixed_hw_reg.nr & 0xf,
+ fprintf(stderr, "arf%d.%d", inst->src[i].fixed_hw_reg.nr & 0xf,
inst->src[i].fixed_hw_reg.subnr);
break;
}
} else {
- printf("hw_reg%d", inst->src[i].fixed_hw_reg.nr);
+ fprintf(stderr, "hw_reg%d", inst->src[i].fixed_hw_reg.nr);
}
if (inst->src[i].fixed_hw_reg.subnr)
- printf("+%d", inst->src[i].fixed_hw_reg.subnr);
+ fprintf(stderr, "+%d", inst->src[i].fixed_hw_reg.subnr);
if (inst->src[i].fixed_hw_reg.abs)
- printf("|");
+ fprintf(stderr, "|");
break;
case BAD_FILE:
- printf("(null)");
+ fprintf(stderr, "(null)");
break;
default:
- printf("???");
+ fprintf(stderr, "???");
break;
}
if (virtual_grf_sizes[inst->src[i].reg] != 1)
- printf(".%d", inst->src[i].reg_offset);
+ fprintf(stderr, ".%d", inst->src[i].reg_offset);
if (inst->src[i].file != IMM) {
static const char *chans[4] = {"x", "y", "z", "w"};
- printf(".");
+ fprintf(stderr, ".");
for (int c = 0; c < 4; c++) {
- printf("%s", chans[BRW_GET_SWZ(inst->src[i].swizzle, c)]);
+ fprintf(stderr, "%s", chans[BRW_GET_SWZ(inst->src[i].swizzle, c)]);
}
}
if (inst->src[i].abs)
- printf("|");
+ fprintf(stderr, "|");
if (inst->src[i].file != IMM) {
- printf(":%s", reg_encoding[inst->src[i].type]);
+ fprintf(stderr, ":%s", reg_encoding[inst->src[i].type]);
}
if (i < 2 && inst->src[i + 1].file != BAD_FILE)
- printf(", ");
+ fprintf(stderr, ", ");
}
- printf("\n");
+ fprintf(stderr, "\n");
}
if (unlikely(debug_flag)) {
if (shader_prog) {
- printf("Native code for %s vertex shader %d:\n",
- shader_prog->Label ? shader_prog->Label : "unnamed",
- shader_prog->Name);
+ fprintf(stderr, "Native code for %s vertex shader %d:\n",
+ shader_prog->Label ? shader_prog->Label : "unnamed",
+ shader_prog->Name);
} else {
- printf("Native code for vertex program %d:\n", prog->Id);
+ fprintf(stderr, "Native code for vertex program %d:\n", prog->Id);
}
}
if (last_annotation_ir != inst->ir) {
last_annotation_ir = inst->ir;
if (last_annotation_ir) {
- printf(" ");
+ fprintf(stderr, " ");
if (shader_prog) {
- ((ir_instruction *) last_annotation_ir)->print();
+ ((ir_instruction *) last_annotation_ir)->fprint(stderr);
} else {
const prog_instruction *vpi;
vpi = (const prog_instruction *) inst->ir;
- printf("%d: ", (int)(vpi - prog->Instructions));
- _mesa_fprint_instruction_opt(stdout, vpi, 0,
+ fprintf(stderr, "%d: ", (int)(vpi - prog->Instructions));
+ _mesa_fprint_instruction_opt(stderr, vpi, 0,
PROG_PRINT_DEBUG, NULL);
}
- printf("\n");
+ fprintf(stderr, "\n");
}
}
if (last_annotation_string != inst->annotation) {
last_annotation_string = inst->annotation;
if (last_annotation_string)
- printf(" %s\n", last_annotation_string);
+ fprintf(stderr, " %s\n", last_annotation_string);
}
}
}
if (unlikely(debug_flag)) {
- brw_dump_compile(p, stdout,
+ brw_dump_compile(p, stderr,
last_native_insn_offset, p->next_insn_offset);
}
}
if (unlikely(debug_flag)) {
- printf("\n");
+ fprintf(stderr, "\n");
}
brw_set_uip_jip(p);
* case you're doing that.
*/
if (0 && unlikely(debug_flag)) {
- brw_dump_compile(p, stdout, 0, p->next_insn_offset);
+ brw_dump_compile(p, stderr, 0, p->next_insn_offset);
}
}
this->result.file = BAD_FILE;
ir->operands[operand]->accept(this);
if (this->result.file == BAD_FILE) {
- printf("Failed to get tree for expression operand:\n");
- ir->operands[operand]->print();
+ fprintf(stderr, "Failed to get tree for expression operand:\n");
+ ir->operands[operand]->fprint(stderr);
exit(1);
}
op[operand] = this->result;
brw_compute_vue_map(brw, &prog_data.base.vue_map, outputs_written);
if (0) {
- _mesa_fprint_program_opt(stdout, &c.vp->program.Base, PROG_PRINT_DEBUG,
+ _mesa_fprint_program_opt(stderr, &c.vp->program.Base, PROG_PRINT_DEBUG,
true);
}
if (unlikely(INTEL_DEBUG & DEBUG_WM)) {
if (prog) {
- printf("Native code for %s fragment shader %d (SIMD%d dispatch):\n",
+ fprintf(stderr,
+ "Native code for %s fragment shader %d (SIMD%d dispatch):\n",
shader_prog->Label ? shader_prog->Label : "unnamed",
shader_prog->Name, dispatch_width);
} else if (fp) {
- printf("Native code for fragment program %d (SIMD%d dispatch):\n",
- prog->Id, dispatch_width);
+ fprintf(stderr,
+ "Native code for fragment program %d (SIMD%d dispatch):\n",
+ prog->Id, dispatch_width);
} else {
- printf("Native code for blorp program (SIMD%d dispatch):\n",
- dispatch_width);
+ fprintf(stderr, "Native code for blorp program (SIMD%d dispatch):\n",
+ dispatch_width);
}
}
bblock_t *block = link->block;
if (block->start == ir) {
- printf(" START B%d", block->block_num);
+ fprintf(stderr, " START B%d", block->block_num);
foreach_list(predecessor_node, &block->parents) {
bblock_link *predecessor_link =
(bblock_link *)predecessor_node;
bblock_t *predecessor_block = predecessor_link->block;
- printf(" <-B%d", predecessor_block->block_num);
+ fprintf(stderr, " <-B%d", predecessor_block->block_num);
}
- printf("\n");
+ fprintf(stderr, "\n");
}
}
if (last_annotation_ir != ir->ir) {
last_annotation_ir = ir->ir;
if (last_annotation_ir) {
- printf(" ");
+ fprintf(stderr, " ");
if (prog) {
- ((ir_instruction *) ir->ir)->print();
+ ((ir_instruction *) ir->ir)->fprint(stderr);
} else if (prog) {
const prog_instruction *fpi;
fpi = (const prog_instruction *) ir->ir;
- printf("%d: ", (int)(fpi - prog->Instructions));
- _mesa_fprint_instruction_opt(stdout,
+ fprintf(stderr, "%d: ", (int)(fpi - prog->Instructions));
+ _mesa_fprint_instruction_opt(stderr,
fpi,
0, PROG_PRINT_DEBUG, NULL);
}
- printf("\n");
+ fprintf(stderr, "\n");
}
}
if (last_annotation_string != ir->annotation) {
last_annotation_string = ir->annotation;
if (last_annotation_string)
- printf(" %s\n", last_annotation_string);
+ fprintf(stderr, " %s\n", last_annotation_string);
}
}
}
if (unlikely(INTEL_DEBUG & DEBUG_WM)) {
- disassemble(stdout, last_native_inst_offset, next_inst_offset);
+ disassemble(stderr, last_native_inst_offset, next_inst_offset);
foreach_list(node, &cfg->block_list) {
bblock_link *link = (bblock_link *)node;
bblock_t *block = link->block;
if (block->end == ir) {
- printf(" END B%d", block->block_num);
+ fprintf(stderr, " END B%d", block->block_num);
foreach_list(successor_node, &block->children) {
bblock_link *successor_link =
(bblock_link *)successor_node;
bblock_t *successor_block = successor_link->block;
- printf(" ->B%d", successor_block->block_num);
+ fprintf(stderr, " ->B%d", successor_block->block_num);
}
- printf("\n");
+ fprintf(stderr, "\n");
}
}
}
}
if (unlikely(INTEL_DEBUG & DEBUG_WM)) {
- printf("\n");
+ fprintf(stderr, "\n");
}
patch_jump_targets();
for (int offset = start; offset < end; offset += 16) {
gen8_instruction *inst = &store[offset / 16];
- printf("0x%08x: ", offset);
+ fprintf(stderr, "0x%08x: ", offset);
if (dump_hex) {
- printf("0x%08x 0x%08x 0x%08x 0x%08x ",
- ((uint32_t *) inst)[3],
- ((uint32_t *) inst)[2],
- ((uint32_t *) inst)[1],
- ((uint32_t *) inst)[0]);
+ fprintf(stderr, "0x%08x 0x%08x 0x%08x 0x%08x ",
+ ((uint32_t *) inst)[3],
+ ((uint32_t *) inst)[2],
+ ((uint32_t *) inst)[1],
+ ((uint32_t *) inst)[0]);
}
- gen8_disassemble(stdout, inst, brw->gen);
+ gen8_disassemble(stderr, inst, brw->gen);
}
}
if (unlikely(debug_flag)) {
if (shader_prog) {
- printf("Native code for %s vertex shader %d:\n",
- shader_prog->Label ? shader_prog->Label : "unnamed",
- shader_prog->Name);
+ fprintf(stderr, "Native code for %s vertex shader %d:\n",
+ shader_prog->Label ? shader_prog->Label : "unnamed",
+ shader_prog->Name);
} else {
- printf("Native code for vertex program %d:\n", prog->Id);
+ fprintf(stderr, "Native code for vertex program %d:\n", prog->Id);
}
}
if (last_annotation_ir != ir->ir) {
last_annotation_ir = ir->ir;
if (last_annotation_ir) {
- printf(" ");
+ fprintf(stderr, " ");
if (shader_prog) {
- ((ir_instruction *) last_annotation_ir)->print();
+ ((ir_instruction *) last_annotation_ir)->fprint(stderr);
} else {
const prog_instruction *vpi;
vpi = (const prog_instruction *) ir->ir;
- printf("%d: ", (int)(vpi - prog->Instructions));
- _mesa_fprint_instruction_opt(stdout, vpi, 0,
+ fprintf(stderr, "%d: ", (int)(vpi - prog->Instructions));
+ _mesa_fprint_instruction_opt(stderr, vpi, 0,
PROG_PRINT_DEBUG, NULL);
}
- printf("\n");
+ fprintf(stderr, "\n");
}
}
if (last_annotation_string != ir->annotation) {
last_annotation_string = ir->annotation;
if (last_annotation_string)
- printf(" %s\n", last_annotation_string);
+ fprintf(stderr, " %s\n", last_annotation_string);
}
}
}
if (unlikely(debug_flag)) {
- disassemble(stdout, last_native_inst_offset, next_inst_offset);
+ disassemble(stderr, last_native_inst_offset, next_inst_offset);
}
last_native_inst_offset = next_inst_offset;
}
if (unlikely(debug_flag)) {
- printf("\n");
+ fprintf(stderr, "\n");
}
patch_jump_targets();
* case you're doing that.
*/
if (0 && unlikely(debug_flag)) {
- disassemble(stdout, 0, next_inst_offset);
+ disassemble(stderr, 0, next_inst_offset);
}
}