summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_llvm.c
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2013-05-03 11:38:50 -0700
committerTom Stellard <[email protected]>2013-05-06 10:54:52 -0700
commitdf27320560cfef439aa299dcea12b900195294c3 (patch)
treeb9d2c7fc54256b0b70d64b92d10788339605f391 /src/gallium/drivers/r600/r600_llvm.c
parente917ed96ae38fc382bac50a6536d761b829ac8cd (diff)
r600g/llvm: Don't feed LLVM output through r600_bytecode_build()
The LLVM backend emits raw ISA now, so we can just its output unmodified.
Diffstat (limited to 'src/gallium/drivers/r600/r600_llvm.c')
-rw-r--r--src/gallium/drivers/r600/r600_llvm.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gallium/drivers/r600/r600_llvm.c b/src/gallium/drivers/r600/r600_llvm.c
index 2ff109c4075..197dfd3664f 100644
--- a/src/gallium/drivers/r600/r600_llvm.c
+++ b/src/gallium/drivers/r600/r600_llvm.c
@@ -579,8 +579,6 @@ LLVMModuleRef r600_tgsi_llvm(
unsigned r600_llvm_compile(
LLVMModuleRef mod,
- unsigned char ** inst_bytes,
- unsigned * inst_byte_count,
enum radeon_family family,
struct r600_bytecode *bc,
boolean *use_kill,
@@ -589,9 +587,14 @@ unsigned r600_llvm_compile(
unsigned r;
struct radeon_llvm_binary binary;
const char * gpu_family = r600_llvm_gpu_string(family);
+
r = radeon_llvm_compile(mod, &binary, gpu_family, dump);
- *inst_bytes = binary.code;
- *inst_byte_count = binary.code_size;
+
+ assert(binary.code_size % 4 == 0);
+ bc->bytecode = CALLOC(1, binary.code_size);
+ memcpy(bc->bytecode, binary.code, binary.code_size);
+ bc->ndw = binary.code_size / 4;
+
bc->ngpr = util_le32_to_cpu(*(uint32_t*)binary.config);
bc->nstack = util_le32_to_cpu(*(uint32_t*)(binary.config + 4));
*use_kill = util_le32_to_cpu(*(uint32_t*)(binary.config + 8));