Lines Matching refs:binary
188 struct ac_shader_binary *binary) in parse_symbol_table() argument
202 binary->global_symbol_offsets = CALLOC(symbol_count, sizeof(uint64_t)); in parse_symbol_table()
211 binary->global_symbol_offsets[binary->global_symbol_count] = in parse_symbol_table()
216 for (i = binary->global_symbol_count; i > 0; --i) { in parse_symbol_table()
217 uint64_t lhs = binary->global_symbol_offsets[i - 1]; in parse_symbol_table()
218 uint64_t rhs = binary->global_symbol_offsets[i]; in parse_symbol_table()
222 binary->global_symbol_offsets[i] = lhs; in parse_symbol_table()
223 binary->global_symbol_offsets[i - 1] = rhs; in parse_symbol_table()
225 ++binary->global_symbol_count; in parse_symbol_table()
232 struct ac_shader_binary *binary) in parse_relocs() argument
236 if (!relocs || !symbols || !binary->reloc_count) { in parse_relocs()
239 binary->relocs = CALLOC(binary->reloc_count, in parse_relocs()
241 for (i = 0; i < binary->reloc_count; i++) { in parse_relocs()
245 struct ac_shader_reloc *reloc = &binary->relocs[i]; in parse_relocs()
258 struct ac_shader_binary *binary) in r600_elf_read() argument
290 binary->code_size = section_data->d_size; in r600_elf_read()
291 binary->code = MALLOC(binary->code_size * sizeof(unsigned char)); in r600_elf_read()
292 memcpy(binary->code, section_data->d_buf, binary->code_size); in r600_elf_read()
295 binary->config_size = section_data->d_size; in r600_elf_read()
296 binary->config = MALLOC(binary->config_size * sizeof(unsigned char)); in r600_elf_read()
297 memcpy(binary->config, section_data->d_buf, binary->config_size); in r600_elf_read()
301 binary->disasm_string = strndup(section_data->d_buf, in r600_elf_read()
305 binary->rodata_size = section_data->d_size; in r600_elf_read()
306 binary->rodata = MALLOC(binary->rodata_size * sizeof(unsigned char)); in r600_elf_read()
307 memcpy(binary->rodata, section_data->d_buf, binary->rodata_size); in r600_elf_read()
311 parse_symbol_table(symbols, §ion_header, binary); in r600_elf_read()
314 binary->reloc_count = section_header.sh_size / in r600_elf_read()
319 parse_relocs(elf, relocs, symbols, symbol_sh_link, binary); in r600_elf_read()
327 if (binary->global_symbol_count) { in r600_elf_read()
328 binary->config_size_per_symbol = in r600_elf_read()
329 binary->config_size / binary->global_symbol_count; in r600_elf_read()
331 binary->global_symbol_count = 1; in r600_elf_read()
332 binary->config_size_per_symbol = binary->config_size; in r600_elf_read()
337 const struct ac_shader_binary *binary, in r600_shader_binary_config_start() argument
341 for (i = 0; i < binary->global_symbol_count; ++i) { in r600_shader_binary_config_start()
342 if (binary->global_symbol_offsets[i] == symbol_offset) { in r600_shader_binary_config_start()
343 unsigned offset = i * binary->config_size_per_symbol; in r600_shader_binary_config_start()
344 return binary->config + offset; in r600_shader_binary_config_start()
347 return binary->config; in r600_shader_binary_config_start()
350 static void r600_shader_binary_read_config(const struct ac_shader_binary *binary, in r600_shader_binary_read_config() argument
357 r600_shader_binary_config_start(binary, symbol_offset); in r600_shader_binary_read_config()
359 for (i = 0; i < binary->config_size_per_symbol; i+= 8) { in r600_shader_binary_read_config()
386 const struct ac_shader_binary *binary, in r600_create_shader() argument
390 assert(binary->code_size % 4 == 0); in r600_create_shader()
391 bc->bytecode = CALLOC(1, binary->code_size); in r600_create_shader()
392 memcpy(bc->bytecode, binary->code, binary->code_size); in r600_create_shader()
393 bc->ndw = binary->code_size / 4; in r600_create_shader()
395 r600_shader_binary_read_config(binary, bc, 0, use_kill); in r600_create_shader()
433 radeon_shader_binary_init(&shader->binary); in evergreen_create_compute_state()
434 r600_elf_read(code, header->num_bytes, &shader->binary); in evergreen_create_compute_state()
435 r600_create_shader(&shader->bc, &shader->binary, &use_kill); in evergreen_create_compute_state()
463 radeon_shader_binary_clean(&shader->binary); in evergreen_delete_compute_state()
877 r600_shader_binary_read_config(&shader->binary, &shader->bc, in evergreen_launch_grid()