Lines Matching refs:cf
40 static int cf_emit(struct ir2_cf *cf, instr_cf_t *instr);
95 struct ir2_cf *cf = shader->cfs[i]; in shader_resolve() local
96 if ((cf->cf_type == EXEC) || (cf->cf_type == EXEC_END)) { in shader_resolve()
99 if (cf->exec.addr && (cf->exec.addr != addr)) in shader_resolve()
100 WARN_MSG("invalid addr '%d' at CF %d", cf->exec.addr, i); in shader_resolve()
101 if (cf->exec.cnt && (cf->exec.cnt != cf->exec.instrs_count)) in shader_resolve()
102 WARN_MSG("invalid cnt '%d' at CF %d", cf->exec.cnt, i); in shader_resolve()
104 for (j = cf->exec.instrs_count - 1; j >= 0; j--) { in shader_resolve()
105 struct ir2_instruction *instr = cf->exec.instrs[j]; in shader_resolve()
113 cf->exec.addr = addr; in shader_resolve()
114 cf->exec.cnt = cf->exec.instrs_count; in shader_resolve()
115 cf->exec.sequence = sequence; in shader_resolve()
117 addr += cf->exec.instrs_count; in shader_resolve()
170 struct ir2_cf *cf = shader->cfs[i]; in ir2_shader_assemble() local
171 if ((cf->cf_type == EXEC) || (cf->cf_type == EXEC_END)) { in ir2_shader_assemble()
172 for (j = 0; j < cf->exec.instrs_count; j++) { in ir2_shader_assemble()
173 ret = instr_emit(cf->exec.instrs[j], ptr, idx++, info); in ir2_shader_assemble()
194 struct ir2_cf *cf = ir2_alloc(shader, sizeof(struct ir2_cf)); in ir2_cf_create() local
196 cf->shader = shader; in ir2_cf_create()
197 cf->cf_type = cf_type; in ir2_cf_create()
199 shader->cfs[shader->cfs_count++] = cf; in ir2_cf_create()
200 return cf; in ir2_cf_create()
208 static int cf_emit(struct ir2_cf *cf, instr_cf_t *instr) in cf_emit() argument
212 instr->opc = cf->cf_type; in cf_emit()
214 switch (cf->cf_type) { in cf_emit()
219 assert(cf->exec.addr <= 0x1ff); in cf_emit()
220 assert(cf->exec.cnt <= 0x6); in cf_emit()
221 assert(cf->exec.sequence <= 0xfff); in cf_emit()
222 instr->exec.address = cf->exec.addr; in cf_emit()
223 instr->exec.count = cf->exec.cnt; in cf_emit()
224 instr->exec.serialize = cf->exec.sequence; in cf_emit()
227 assert(cf->alloc.size <= 0xf); in cf_emit()
228 instr->alloc.size = cf->alloc.size; in cf_emit()
229 switch (cf->alloc.type) { in cf_emit()
232 instr->alloc.buffer_select = cf->alloc.type; in cf_emit()
235 ERROR_MSG("invalid alloc type: %d", cf->alloc.type); in cf_emit()
259 struct ir2_instruction * ir2_instr_create(struct ir2_cf *cf, int instr_type) in ir2_instr_create() argument
262 ir2_alloc(cf->shader, sizeof(struct ir2_instruction)); in ir2_instr_create()
264 instr->shader = cf->shader; in ir2_instr_create()
265 instr->pred = cf->shader->pred; in ir2_instr_create()
267 assert(cf->exec.instrs_count < ARRAY_SIZE(cf->exec.instrs)); in ir2_instr_create()
268 cf->exec.instrs[cf->exec.instrs_count++] = instr; in ir2_instr_create()