elf = elf_memory(elf_buffer, buffer_size);
elf_getshdrstrndx(elf, §ion_str_index);
+ binary->disassembled = 0;
while ((section = elf_nextscn(elf, section))) {
const char *name;
binary->config_size = section_data->d_size;
binary->config = MALLOC(binary->config_size * sizeof(unsigned char));
memcpy(binary->config, section_data->d_buf, binary->config_size);
+ } else if (dump && !strcmp(name, ".AMDGPU.disasm")) {
+ binary->disassembled = 1;
+ section_data = elf_getdata(section, section_data);
+ fprintf(stderr, "\nShader Disassembly:\n\n");
+ fprintf(stderr, "%.*s\n", (int)section_data->d_size,
+ (char *)section_data->d_buf);
}
}
memset(&binary, 0, sizeof(binary));
radeon_llvm_compile(mod, &binary,
r600_get_llvm_processor_name(rctx->screen->b.family), dump);
- if (dump) {
+ if (dump && ! binary.disassembled) {
fprintf(stderr, "SI CODE:\n");
for (i = 0; i < binary.code_size; i+=4 ) {
fprintf(stderr, "%02x%02x%02x%02x\n", binary.code[i + 3],