r600g/llvm: Add support for cf_alu native encode
authorVincent Lejeune <vljn@ovi.com>
Tue, 26 Mar 2013 14:00:18 +0000 (15:00 +0100)
committerVincent Lejeune <vljn@ovi.com>
Mon, 1 Apr 2013 21:43:27 +0000 (23:43 +0200)
src/gallium/drivers/r600/r600_asm.c
src/gallium/drivers/r600/r600_asm.h
src/gallium/drivers/r600/r600_shader.c

index 0d570ca250521a58db2e64b6779928a81d76d9bf..65c705d0aa820f1562c8d00b5d24812d2236a934 100644 (file)
@@ -106,7 +106,7 @@ void r600_bytecode_init(struct r600_bytecode *bc,
        bc->msaa_texture_mode = msaa_texture_mode;
 }
 
-static int r600_bytecode_add_cf(struct r600_bytecode *bc)
+int r600_bytecode_add_cf(struct r600_bytecode *bc)
 {
        struct r600_bytecode_cf *cf = r600_bytecode_cf();
 
index 1465c313b79147d37527df47e95a586a8235a673..c1aa3bae4e3aa4598127f8de923029b0e78f23c9 100644 (file)
@@ -227,6 +227,7 @@ int r600_bytecode_add_tex(struct r600_bytecode *bc,
 int r600_bytecode_add_output(struct r600_bytecode *bc,
                const struct r600_bytecode_output *output);
 int r600_bytecode_build(struct r600_bytecode *bc);
+int r600_bytecode_add_cf(struct r600_bytecode *bc);
 int r600_bytecode_add_cfinst(struct r600_bytecode *bc,
                unsigned op);
 int r600_bytecode_add_alu_type(struct r600_bytecode *bc,
index 1e2155939ed621fc5b81335b94e80f7f7d795572..c51773af5b2a68ef78248426b2b8321a1e6fd29b 100644 (file)
@@ -626,6 +626,20 @@ static void r600_bytecode_from_byte_stream(struct r600_shader_ctx *ctx,
             bytes_read = r600_export_from_byte_stream(ctx, bytes,
                                 bytes_read);
             break;
+               case 6: {
+                       int32_t word0 = i32_from_byte_stream(bytes, &bytes_read);
+                       int32_t word1 = i32_from_byte_stream(bytes, &bytes_read);
+
+                       r600_bytecode_add_cf(ctx->bc);
+                       ctx->bc->cf_last->op = r600_isa_cf_by_opcode(ctx->bc->isa, 8/* CF_ALU*/, 1);
+                       ctx->bc->cf_last->kcache[0].bank = G_SQ_CF_ALU_WORD0_KCACHE_BANK0(word0);
+                       ctx->bc->cf_last->kcache[0].addr = G_SQ_CF_ALU_WORD1_KCACHE_ADDR0(word1);
+                       ctx->bc->cf_last->kcache[0].mode = G_SQ_CF_ALU_WORD0_KCACHE_MODE0(word0);
+                       ctx->bc->cf_last->kcache[1].bank = G_SQ_CF_ALU_WORD0_KCACHE_BANK1(word0);
+                       ctx->bc->cf_last->kcache[1].addr = G_SQ_CF_ALU_WORD1_KCACHE_ADDR1(word1);
+                       ctx->bc->cf_last->kcache[1].mode = G_SQ_CF_ALU_WORD1_KCACHE_MODE1(word1);
+                       break;
+      }
                default:
                        /* XXX: Error here */
                        break;