Lines Matching refs: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()
268 scan_register *reg, in check_register_usage() argument
272 if (!check_file_name( ctx, reg->file )) { in check_register_usage()
273 FREE(reg); in check_register_usage()
280 reg->indices[0] = 0; in check_register_usage()
281 reg->indices[1] = 0; in check_register_usage()
282 if (!is_any_register_declared( ctx, reg->file )) in check_register_usage()
283 report_error( ctx, "%s: Undeclared %s register", file_names[reg->file], name ); in check_register_usage()
284 if (!is_ind_register_used(ctx, reg)) in check_register_usage()
285 cso_hash_insert(ctx->regs_ind_used, reg->file, reg); in check_register_usage()
287 FREE(reg); in check_register_usage()
290 if (!is_register_declared( ctx, reg )) { in check_register_usage()
291 if (reg->dimensions == 2) { in check_register_usage()
292 report_error( ctx, "%s[%d][%d]: Undeclared %s register", file_names[reg->file], in check_register_usage()
293 reg->indices[0], reg->indices[1], name ); in check_register_usage()
296 report_error( ctx, "%s[%d]: Undeclared %s register", file_names[reg->file], in check_register_usage()
297 reg->indices[0], name ); in check_register_usage()
300 if (!is_register_used( ctx, reg )) in check_register_usage()
301 cso_hash_insert(ctx->regs_used, scan_register_key(reg), reg); in check_register_usage()
303 FREE(reg); in check_register_usage()
341 scan_register *reg = create_scan_register_dst(&inst->Dst[i]); in iter_instruction() local
344 reg, in iter_instruction()
352 scan_register *reg = create_scan_register_src(&inst->Src[i]); in iter_instruction() local
355 reg, in iter_instruction()
379 scan_register *reg) in check_and_declare() argument
381 if (is_register_declared( ctx, reg)) in check_and_declare()
383 file_names[reg->file], reg->indices[0] ); in check_and_declare()
385 scan_register_key(reg), in check_and_declare()
386 reg); in check_and_declare()
417 scan_register *reg = MALLOC(sizeof(scan_register)); in iter_declaration() local
418 fill_scan_register2d(reg, file, i, vert); in iter_declaration()
419 check_and_declare(ctx, reg); in iter_declaration()
422 scan_register *reg = MALLOC(sizeof(scan_register)); in iter_declaration() local
424 fill_scan_register2d(reg, file, i, decl->Dim.Index2D); in iter_declaration()
426 fill_scan_register1d(reg, file, i); in iter_declaration()
428 check_and_declare(ctx, reg); in iter_declaration()
441 scan_register *reg; in iter_immediate() local
450 reg = MALLOC(sizeof(scan_register)); in iter_immediate()
451 fill_scan_register1d(reg, TGSI_FILE_IMMEDIATE, ctx->num_imms); in iter_immediate()
452 cso_hash_insert(ctx->regs_decl, scan_register_key(reg), reg); in iter_immediate()
501 scan_register *reg = (scan_register *)cso_hash_iter_data(iter); in epilog() local
502 if (!is_register_used(ctx, reg) && !is_ind_register_used(ctx, reg)) { in epilog()
504 file_names[reg->file], reg->indices[0] ); in epilog()
523 scan_register *reg = (scan_register *)cso_hash_iter_data(iter); in regs_hash_destroy() local
525 assert(reg->file < TGSI_FILE_COUNT); in regs_hash_destroy()
526 FREE(reg); in regs_hash_destroy()