Lines Matching full:reg
66 scan_register_key(const scan_register *reg) in scan_register_key() argument
68 unsigned key = reg->file; in scan_register_key()
69 key |= (reg->indices[0] << 4); in scan_register_key()
70 key |= (reg->indices[1] << 18); in scan_register_key()
76 fill_scan_register1d(scan_register *reg, in fill_scan_register1d() argument
79 reg->file = file; in fill_scan_register1d()
80 reg->dimensions = 1; in fill_scan_register1d()
81 reg->indices[0] = index; in fill_scan_register1d()
82 reg->indices[1] = 0; in fill_scan_register1d()
86 fill_scan_register2d(scan_register *reg, in fill_scan_register2d() argument
89 reg->file = file; in fill_scan_register2d()
90 reg->dimensions = 2; in fill_scan_register2d()
91 reg->indices[0] = index1; in fill_scan_register2d()
92 reg->indices[1] = index2; in fill_scan_register2d()
96 scan_register_dst(scan_register *reg, in scan_register_dst() argument
102 fill_scan_register2d(reg, in scan_register_dst()
107 fill_scan_register1d(reg, in scan_register_dst()
114 scan_register_src(scan_register *reg, in scan_register_src() argument
120 fill_scan_register2d(reg, in scan_register_src()
125 fill_scan_register1d(reg, in scan_register_src()
134 scan_register *reg = MALLOC(sizeof(scan_register)); in create_scan_register_src() local
135 scan_register_src(reg, src); in create_scan_register_src()
137 return reg; in create_scan_register_src()
143 scan_register *reg = MALLOC(sizeof(scan_register)); in create_scan_register_dst() local
144 scan_register_dst(reg, dst); in create_scan_register_dst()
146 return reg; in create_scan_register_dst()
202 const scan_register *reg) in is_register_declared() argument
205 ctx->regs_decl, scan_register_key(reg), in is_register_declared()
206 (void*)reg, sizeof(scan_register)); in is_register_declared()
219 scan_register *reg = (scan_register *)cso_hash_iter_data(iter); in is_any_register_declared() local
220 if (reg->file == file) in is_any_register_declared()
231 scan_register *reg) in is_register_used() argument
234 ctx->regs_used, scan_register_key(reg), in is_register_used()
235 reg, sizeof(scan_register)); in is_register_used()
243 scan_register *reg) in is_ind_register_used() argument
245 return cso_hash_contains(ctx->regs_ind_used, reg->file); in is_ind_register_used()
266 scan_register *reg, in check_register_usage() argument
270 if (!check_file_name( ctx, reg->file )) { in check_register_usage()
271 FREE(reg); in check_register_usage()
278 reg->indices[0] = 0; in check_register_usage()
279 reg->indices[1] = 0; in check_register_usage()
280 if (!is_any_register_declared( ctx, reg->file )) in check_register_usage()
281 report_error( ctx, "%s: Undeclared %s register", file_names[reg->file], name ); in check_register_usage()
282 if (!is_ind_register_used(ctx, reg)) in check_register_usage()
283 cso_hash_insert(ctx->regs_ind_used, reg->file, reg); in check_register_usage()
285 FREE(reg); in check_register_usage()
288 if (!is_register_declared( ctx, reg )) { in check_register_usage()
289 if (reg->dimensions == 2) { in check_register_usage()
290 report_error( ctx, "%s[%d][%d]: Undeclared %s register", file_names[reg->file], in check_register_usage()
291 reg->indices[0], reg->indices[1], name ); in check_register_usage()
294 report_error( ctx, "%s[%d]: Undeclared %s register", file_names[reg->file], in check_register_usage()
295 reg->indices[0], name ); in check_register_usage()
298 if (!is_register_used( ctx, reg )) in check_register_usage()
299 cso_hash_insert(ctx->regs_used, scan_register_key(reg), reg); in check_register_usage()
301 FREE(reg); in check_register_usage()
339 scan_register *reg = create_scan_register_dst(&inst->Dst[i]); in iter_instruction() local
342 reg, in iter_instruction()
350 scan_register *reg = create_scan_register_src(&inst->Src[i]); in iter_instruction() local
353 reg, in iter_instruction()
377 scan_register *reg) in check_and_declare() argument
379 if (is_register_declared( ctx, reg)) in check_and_declare()
381 file_names[reg->file], reg->indices[0] ); in check_and_declare()
383 scan_register_key(reg), in check_and_declare()
384 reg); in check_and_declare()
415 scan_register *reg = MALLOC(sizeof(scan_register)); in iter_declaration() local
416 fill_scan_register2d(reg, file, i, vert); in iter_declaration()
417 check_and_declare(ctx, reg); in iter_declaration()
420 scan_register *reg = MALLOC(sizeof(scan_register)); in iter_declaration() local
422 fill_scan_register2d(reg, file, i, decl->Dim.Index2D); in iter_declaration()
424 fill_scan_register1d(reg, file, i); in iter_declaration()
426 check_and_declare(ctx, reg); in iter_declaration()
439 scan_register *reg; in iter_immediate() local
448 reg = MALLOC(sizeof(scan_register)); in iter_immediate()
449 fill_scan_register1d(reg, TGSI_FILE_IMMEDIATE, ctx->num_imms); in iter_immediate()
450 cso_hash_insert(ctx->regs_decl, scan_register_key(reg), reg); in iter_immediate()
500 scan_register *reg = (scan_register *)cso_hash_iter_data(iter); in epilog() local
501 if (!is_register_used(ctx, reg) && !is_ind_register_used(ctx, reg)) { in epilog()
503 file_names[reg->file], reg->indices[0] ); in epilog()
522 scan_register *reg = (scan_register *)cso_hash_iter_data(iter); in regs_hash_destroy() local
524 assert(reg->file < TGSI_FILE_COUNT); in regs_hash_destroy()
525 FREE(reg); in regs_hash_destroy()