Lines Matching defs:bc
70 pipe_buffer_create(ctx->screen, PIPE_BIND_CUSTOM, PIPE_USAGE_IMMUTABLE, rshader->bc.ndw * 4);
76 for (i = 0; i < rshader->bc.ndw; ++i) {
77 ptr[i] = bswap_32(rshader->bc.bytecode[i]);
80 memcpy(ptr, rshader->bc.bytecode, rshader->bc.ndw * sizeof(*ptr));
144 r = r600_bytecode_build(&shader->shader.bc);
150 r600_bytecode_dump(&shader->shader.bc);
159 r600_bytecode_clear(&shader->shader.bc);
184 struct r600_bytecode *bc;
245 shader_ctx.bc = bytecode;
246 r600_bytecode_init(shader_ctx.bc, r600_ctx->chip_class, r600_ctx->family);
247 shader_ctx.bc->type = TGSI_PROCESSOR_COMPUTE;
249 if (shader_ctx.bc->chip_class == CAYMAN) {
250 cm_bytecode_add_cf_end(shader_ctx.bc);
252 r600_bytecode_build(shader_ctx.bc);
254 r600_bytecode_dump(shader_ctx.bc);
336 r600_bytecode_add_alu_type(ctx->bc, &alu, CTX_INST(V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU_PUSH_BEFORE));
338 r600_bytecode_add_alu(ctx->bc, &alu);
345 ctx->bc->force_add_cf = 1;
353 r600_bytecode_add_cfinst(ctx->bc, CTX_INST(V_SQ_CF_WORD1_SQ_CF_INST_JUMP));
362 if (ctx->bc->chip_class == CAYMAN)
364 else if (ctx->bc->chip_class >= EVERGREEN)
413 if (ctx->bc->chip_class == CAYMAN) {
416 } else if (ctx->bc->chip_class >= EVERGREEN) {
468 r600_bytecode_add_tex(ctx->bc, &tex);
508 if (r600_bytecode_add_vtx(ctx->bc, &vtx)) {
512 ctx->bc->cf_last->inst = EG_V_SQ_CF_WORD1_SQ_CF_INST_TEX;
537 r600_bytecode_add_cfinst(ctx->bc, CF_NATIVE);
540 ctx->bc->cf_last->isa[i] |=
645 r = r600_bytecode_add_alu(ctx->bc, &alu);
672 r = r600_bytecode_add_alu(ctx->bc, &alu);
781 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
815 if (ctx->bc->chip_class >= EVERGREEN) {
872 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
997 alu.src[0].sel = ctx->bc->ar_reg;
1006 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
1011 ar_reg = ctx->bc->ar_reg;
1029 if ((r = r600_bytecode_add_vtx(ctx->bc, &vtx)))
1073 r = r600_bytecode_add_alu(ctx->bc, &alu);
1111 r = r600_bytecode_add_alu(ctx->bc, &alu);
1149 if (ctx->bc->chip_class >= EVERGREEN) {
1184 ctx.bc = &shader->bc;
1188 r600_bytecode_init(ctx.bc, rctx->chip_class, rctx->family);
1194 ctx.bc->type = shader->processor_type;
1232 if (ctx.bc->chip_class >= EVERGREEN) {
1233 r600_bytecode_add_cfinst(ctx.bc, EG_V_SQ_CF_WORD1_SQ_CF_INST_CALL_FS);
1235 r600_bytecode_add_cfinst(ctx.bc, V_SQ_CF_WORD1_SQ_CF_INST_CALL_FS);
1238 if (ctx.type == TGSI_PROCESSOR_FRAGMENT && ctx.bc->chip_class >= EVERGREEN) {
1289 ctx.bc->ar_reg = ctx.file_offset[TGSI_FILE_TEMPORARY] +
1291 ctx.temp_reg = ctx.bc->ar_reg + 1;
1343 if (ctx.bc->chip_class == CAYMAN) {
1347 alu.inst = BC_INST(ctx.bc, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_RECIP_IEEE);
1355 if ((r = r600_bytecode_add_alu(ctx.bc, &alu)))
1361 alu.inst = BC_INST(ctx.bc, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_RECIP_IEEE);
1369 if ((r = r600_bytecode_add_alu(ctx.bc, &alu)))
1399 if (ctx.bc->chip_class == CAYMAN)
1401 else if (ctx.bc->chip_class >= EVERGREEN)
1446 alu.inst = BC_INST(ctx.bc, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_DOT4);
1459 r = r600_bytecode_add_alu(ctx.bc, &alu);
1494 if (ctx.bc->chip_class >= EVERGREEN) {
1525 r = r600_bytecode_add_output(ctx.bc, &output);
1543 output[j].inst = BC_INST(ctx.bc, V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT);
1604 output[j].inst = BC_INST(ctx.bc, V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT);
1652 output[j].inst = BC_INST(ctx.bc, V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT);
1669 output[j].inst = BC_INST(ctx.bc, V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT);
1677 if (ctx.bc->chip_class < CAYMAN) {
1684 output[i].inst = BC_INST(ctx.bc, V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT_DONE);
1689 r = r600_bytecode_add_output(ctx.bc, &output[i]);
1694 if (ctx.bc->chip_class == CAYMAN)
1695 cm_bytecode_add_cf_end(ctx.bc);
1699 if (ctx.bc->ngpr > 124) {
1700 R600_ERR("GPR limit exceeded - shader requires %d registers\n", ctx.bc->ngpr);
1816 r = r600_bytecode_add_alu(ctx->bc, &alu);
1861 r = r600_bytecode_add_alu(ctx->bc, &alu);
1892 r = r600_bytecode_add_alu(ctx->bc, &alu);
1919 r = r600_bytecode_add_alu(ctx->bc, &alu);
1957 r = r600_bytecode_add_alu(ctx->bc, &alu);
1971 r = r600_bytecode_add_alu(ctx->bc, &alu);
1991 if (ctx->bc->chip_class == R600) {
2001 r = r600_bytecode_add_alu(ctx->bc, &alu);
2031 r = r600_bytecode_add_alu(ctx->bc, &alu);
2058 r = r600_bytecode_add_alu(ctx->bc, &alu);
2074 r = r600_bytecode_add_alu(ctx->bc, &alu);
2098 if (ctx->bc->chip_class == CAYMAN) {
2112 r = r600_bytecode_add_alu(ctx->bc, &alu);
2124 r = r600_bytecode_add_alu(ctx->bc, &alu);
2132 if (ctx->bc->chip_class == CAYMAN) {
2145 r = r600_bytecode_add_alu(ctx->bc, &alu);
2157 r = r600_bytecode_add_alu(ctx->bc, &alu);
2176 r = r600_bytecode_add_alu(ctx->bc, &alu);
2194 r = r600_bytecode_add_alu(ctx->bc, &alu);
2224 r = r600_bytecode_add_alu(ctx->bc, &alu);
2230 ctx->bc->force_add_cf = 1;
2253 r = r600_bytecode_add_alu(ctx->bc, &alu);
2263 if (ctx->bc->chip_class == CAYMAN) {
2278 r = r600_bytecode_add_alu(ctx->bc, &alu);
2292 r = r600_bytecode_add_alu(ctx->bc, &alu);
2312 r = r600_bytecode_add_alu(ctx->bc, &alu);
2316 if (ctx->bc->chip_class == CAYMAN) {
2329 r = r600_bytecode_add_alu(ctx->bc, &alu);
2341 r = r600_bytecode_add_alu(ctx->bc, &alu);
2354 r = r600_bytecode_add_alu(ctx->bc, &alu);
2366 r = r600_bytecode_add_alu(ctx->bc, &alu);
2378 r = r600_bytecode_add_alu(ctx->bc, &alu);
2406 r = r600_bytecode_add_alu(ctx->bc, &alu);
2428 r = r600_bytecode_add_alu(ctx->bc, &alu);
2449 r = r600_bytecode_add_alu(ctx->bc, &alu);
2472 r = r600_bytecode_add_alu(ctx->bc, &alu);
2485 r = r600_bytecode_add_alu(ctx->bc, &alu);
2499 r = r600_bytecode_add_alu(ctx->bc, &alu);
2518 r = r600_bytecode_add_alu(ctx->bc, &alu);
2529 r = r600_bytecode_add_alu(ctx->bc, &alu);
2539 r = r600_bytecode_add_alu(ctx->bc, &alu);
2620 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2636 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2654 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2673 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2691 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2697 if (ctx->bc->chip_class == CAYMAN) {
2714 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2731 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2747 r = r600_bytecode_add_alu(ctx->bc, &alu);
2762 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2781 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2786 if (ctx->bc->chip_class == CAYMAN) {
2805 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2826 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2843 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2847 if (ctx->bc->chip_class == CAYMAN) {
2866 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2888 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2909 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2913 if (ctx->bc->chip_class == CAYMAN) {
2929 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2947 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2965 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2982 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3002 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3006 if (ctx->bc->chip_class == CAYMAN) {
3026 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3048 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3053 if (ctx->bc->chip_class == CAYMAN) {
3073 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3095 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3118 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3139 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3161 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3185 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3206 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3224 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3240 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3259 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3280 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3304 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3326 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3344 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3362 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3381 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3432 r = r600_bytecode_add_alu(ctx->bc, &alu);
3451 r = r600_bytecode_add_alu(ctx->bc, &alu);
3484 r = r600_bytecode_add_alu(ctx->bc, &alu);
3508 r = r600_bytecode_add_alu(ctx->bc, &alu);
3542 r = r600_bytecode_add_alu(ctx->bc, &alu);
3569 r = r600_bytecode_add_alu(ctx->bc, &alu);
3599 r = r600_bytecode_add_alu(ctx->bc, &alu);
3623 r = r600_bytecode_add_alu(ctx->bc, &alu);
3649 r = r600_bytecode_add_alu(ctx->bc, &alu);
3680 r = r600_bytecode_add_alu(ctx->bc, &alu);
3730 r = r600_bytecode_add_alu(ctx->bc, &alu);
3810 r = r600_bytecode_add_alu(ctx->bc, &alu);
3831 r = r600_bytecode_add_tex(ctx->bc, &tex);
3838 if (ctx->bc->chip_class == CAYMAN) {
3851 r = r600_bytecode_add_alu(ctx->bc, &alu);
3866 r = r600_bytecode_add_alu(ctx->bc, &alu);
3880 r = r600_bytecode_add_alu(ctx->bc, &alu);
3892 r = r600_bytecode_add_alu(ctx->bc, &alu);
3918 r = r600_bytecode_add_alu(ctx->bc, &alu);
3924 if (ctx->bc->chip_class == CAYMAN) {
3937 r = r600_bytecode_add_alu(ctx->bc, &alu);
3951 r = r600_bytecode_add_alu(ctx->bc, &alu);
3977 r = r600_bytecode_add_alu(ctx->bc, &alu);
3999 r = r600_bytecode_add_alu(ctx->bc, &alu);
4011 r = r600_bytecode_add_alu(ctx->bc, &alu);
4027 r = r600_bytecode_add_alu(ctx->bc, &alu);
4046 r = r600_bytecode_add_alu(ctx->bc, &alu);
4155 r = r600_bytecode_add_tex(ctx->bc, &tex);
4187 r = r600_bytecode_add_alu(ctx->bc, &alu);
4211 r = r600_bytecode_add_alu(ctx->bc, &alu);
4232 r = r600_bytecode_add_alu(ctx->bc, &alu);
4255 r = r600_bytecode_add_alu(ctx->bc, &alu);
4284 r = r600_bytecode_add_alu(ctx->bc, &alu);
4322 r = r600_bytecode_add_alu(ctx->bc, &alu);
4354 r = r600_bytecode_add_alu(ctx->bc, &alu);
4381 r = r600_bytecode_add_alu(ctx->bc, &alu);
4385 if (ctx->bc->chip_class == CAYMAN) {
4395 r = r600_bytecode_add_alu(ctx->bc, &alu);
4408 r = r600_bytecode_add_alu(ctx->bc, &alu);
4432 r = r600_bytecode_add_alu(ctx->bc, &alu);
4439 if (ctx->bc->chip_class == CAYMAN) {
4452 r = r600_bytecode_add_alu(ctx->bc, &alu);
4467 r = r600_bytecode_add_alu(ctx->bc, &alu);
4485 r = r600_bytecode_add_alu(ctx->bc, &alu);
4501 if (ctx->bc->chip_class == CAYMAN) {
4515 r = r600_bytecode_add_alu(ctx->bc, &alu);
4531 r = r600_bytecode_add_alu(ctx->bc, &alu);
4545 r = r600_bytecode_add_alu(ctx->bc, &alu);
4553 if (ctx->bc->chip_class == CAYMAN) {
4568 r = r600_bytecode_add_alu(ctx->bc, &alu);
4584 r = r600_bytecode_add_alu(ctx->bc, &alu);
4600 r = r600_bytecode_add_alu(ctx->bc, &alu);
4604 if (ctx->bc->chip_class == CAYMAN) {
4618 r = r600_bytecode_add_alu(ctx->bc, &alu);
4633 r = r600_bytecode_add_alu(ctx->bc, &alu);
4638 if (ctx->bc->chip_class == CAYMAN) {
4652 r = r600_bytecode_add_alu(ctx->bc, &alu);
4667 r = r600_bytecode_add_alu(ctx->bc, &alu);
4687 r = r600_bytecode_add_alu(ctx->bc, &alu);
4694 if (ctx->bc->chip_class == CAYMAN) {
4709 r = r600_bytecode_add_alu(ctx->bc, &alu);
4725 r = r600_bytecode_add_alu(ctx->bc, &alu);
4744 r = r600_bytecode_add_alu(ctx->bc, &alu);
4777 alu.dst.sel = ctx->bc->ar_reg;
4779 r = r600_bytecode_add_alu(ctx->bc, &alu);
4783 ctx->bc->ar_loaded = 0;
4797 alu.dst.sel = ctx->bc->ar_reg;
4801 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
4806 alu.src[0].sel = ctx->bc->ar_reg;
4807 alu.dst.sel = ctx->bc->ar_reg;
4811 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
4818 alu.dst.sel = ctx->bc->ar_reg;
4822 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
4829 alu.dst.sel = ctx->bc->ar_reg;
4833 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
4841 ctx->bc->ar_loaded = 0;
4870 r = r600_bytecode_add_alu(ctx->bc, &alu);
4897 r = r600_bytecode_add_alu_type(ctx->bc, &alu, CTX_INST(V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU_PUSH_BEFORE));
4905 unsigned force_pop = ctx->bc->force_add_cf;
4909 if (ctx->bc->cf_last) {
4910 if (ctx->bc->cf_last->inst == CTX_INST(V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU))
4912 else if (ctx->bc->cf_last->inst == CTX_INST(V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU_POP_AFTER))
4917 ctx->bc->cf_last->inst = CTX_INST(V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU_POP_AFTER);
4918 ctx->bc->force_add_cf = 1;
4920 ctx->bc->cf_last->inst = CTX_INST(V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU_POP2_AFTER);
4921 ctx->bc->force_add_cf = 1;
4928 r600_bytecode_add_cfinst(ctx->bc, CTX_INST(V_SQ_CF_WORD1_SQ_CF_INST_POP));
4929 ctx->bc->cf_last->pop_count = pops;
4930 ctx->bc->cf_last->cf_addr = ctx->bc->cf_last->id + 2;
4940 ctx->bc->callstack[ctx->bc->call_sp].current--;
4944 ctx->bc->callstack[ctx->bc->call_sp].current -= 4;
4948 ctx->bc->callstack[ctx->bc->call_sp].current --;
4968 if ((ctx->bc->callstack[ctx->bc->call_sp].current + diff) >
4969 ctx->bc->callstack[ctx->bc->call_sp].max) {
4970 ctx->bc->callstack[ctx->bc->call_sp].max =
4971 ctx->bc->callstack[ctx->bc->call_sp].current + diff;
4977 ctx->bc->callstack[ctx->bc->call_sp].current++;
4981 ctx->bc->callstack[ctx->bc->call_sp].current += 4;
4984 ctx->bc->callstack[ctx->bc->call_sp].current++;
4988 if ((ctx->bc->callstack[ctx->bc->call_sp].current) >
4989 ctx->bc->callstack[ctx->bc->call_sp].max) {
4990 ctx->bc->callstack[ctx->bc->call_sp].max =
4991 ctx->bc->callstack[ctx->bc->call_sp].current;
4997 struct r600_cf_stack_entry *sp = &ctx->bc->fc_stack[fc_sp];
5001 sp->mid[sp->num_mid] = ctx->bc->cf_last;
5007 ctx->bc->fc_sp++;
5008 ctx->bc->fc_stack[ctx->bc->fc_sp].type = type;
5009 ctx->bc->fc_stack[ctx->bc->fc_sp].start = ctx->bc->cf_last;
5014 struct r600_cf_stack_entry *sp = &ctx->bc->fc_stack[ctx->bc->fc_sp];
5022 ctx->bc->fc_sp--;
5028 r600_bytecode_add_cfinst(ctx->bc, CTX_INST(V_SQ_CF_WORD1_SQ_CF_INST_RETURN));
5035 r600_bytecode_add_cfinst(ctx->bc, CTX_INST(V_SQ_CF_WORD1_SQ_CF_INST_JUMP));
5036 ctx->bc->cf_last->pop_count = pops;
5064 r600_bytecode_add_cfinst(ctx->bc, ctx->inst_info->r600_opcode);
5065 ctx->bc->cf_last->pop_count = 1;
5077 r600_bytecode_add_cfinst(ctx->bc, CTX_INST(V_SQ_CF_WORD1_SQ_CF_INST_JUMP));
5087 r600_bytecode_add_cfinst(ctx->bc, CTX_INST(V_SQ_CF_WORD1_SQ_CF_INST_ELSE));
5088 ctx->bc->cf_last->pop_count = 1;
5090 fc_set_mid(ctx, ctx->bc->fc_sp);
5091 ctx->bc->fc_stack[ctx->bc->fc_sp].start->cf_addr = ctx->bc->cf_last->id;
5098 if (ctx->bc->fc_stack[ctx->bc->fc_sp].type != FC_IF) {
5103 if (ctx->bc->fc_stack[ctx->bc->fc_sp].mid == NULL) {
5104 ctx->bc->fc_stack[ctx->bc->fc_sp].start->cf_addr = ctx->bc->cf_last->id + 2;
5105 ctx->bc->fc_stack[ctx->bc->fc_sp].start->pop_count = 1;
5107 ctx->bc->fc_stack[ctx->bc->fc_sp].mid[0]->cf_addr = ctx->bc->cf_last->id + 2;
5119 r600_bytecode_add_cfinst(ctx->bc, CTX_INST(V_SQ_CF_WORD1_SQ_CF_INST_LOOP_START_DX10));
5132 r600_bytecode_add_cfinst(ctx->bc, CTX_INST(V_SQ_CF_WORD1_SQ_CF_INST_LOOP_END));
5134 if (ctx->bc->fc_stack[ctx->bc->fc_sp].type != FC_LOOP) {
5144 ctx->bc->cf_last->cf_addr = ctx->bc->fc_stack[ctx->bc->fc_sp].start->id + 2;
5146 ctx->bc->fc_stack[ctx->bc->fc_sp].start->cf_addr = ctx->bc->cf_last->id + 2;
5148 for (i = 0; i < ctx->bc->fc_stack[ctx->bc->fc_sp].num_mid; i++) {
5149 ctx->bc->fc_stack[ctx->bc->fc_sp].mid[i]->cf_addr = ctx->bc->cf_last->id;
5161 for (fscp = ctx->bc->fc_sp; fscp > 0; fscp--)
5163 if (FC_LOOP == ctx->bc->fc_stack[fscp].type)
5172 r600_bytecode_add_cfinst(ctx->bc, ctx->inst_info->r600_opcode);
5204 r = r600_bytecode_add_alu(ctx->bc, &alu);
5226 r = r600_bytecode_add_alu(ctx->bc, &alu);