Module: Mesa
Branch: master
Commit: 8f597d57e959830040473b548e0e04cfc63866c2
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8f597d57e959830040473b548e0e04cfc63866c2

Author: Vincent Lejeune <[email protected]>
Date:   Sat Aug  4 00:15:51 2012 +0200

r600g: Glue to handle predicate aware output from llvm

Signed-off-by: Tom Stellard <[email protected]>

---

 src/gallium/drivers/r600/r600_shader.c |   33 +++++++++++++++++++++----------
 1 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_shader.c 
b/src/gallium/drivers/r600/r600_shader.c
index dfaff83..3ca23c5 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -293,6 +293,7 @@ static unsigned r600_alu_from_byte_stream(struct 
r600_shader_ctx *ctx,
 {
        unsigned src_idx;
        unsigned inst0, inst1;
+       unsigned push_modifier;
        struct r600_bytecode_alu alu;
        memset(&alu, 0, sizeof(alu));
        for(src_idx = 0; src_idx < 3; src_idx++) {
@@ -310,12 +311,32 @@ static unsigned r600_alu_from_byte_stream(struct 
r600_shader_ctx *ctx,
        alu.inst = inst0 | (inst1 << 8);
        alu.last = bytes[bytes_read++];
        alu.is_op3 = bytes[bytes_read++];
+       push_modifier = bytes[bytes_read++];
        alu.pred_sel = bytes[bytes_read++];
        alu.bank_swizzle = bytes[bytes_read++];
        alu.bank_swizzle_force = bytes[bytes_read++];
        alu.omod = bytes[bytes_read++];
        alu.index_mode = bytes[bytes_read++];
-       r600_bytecode_add_alu(ctx->bc, &alu);
+
+
+       if (alu.inst == CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETNE) ||
+           alu.inst == CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETE) ||
+           alu.inst == CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETE_INT) 
||
+           alu.inst == 
CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETNE_INT)) {
+               alu.update_pred = 1;
+               alu.dst.write = 0;
+               alu.src[1].sel = V_SQ_ALU_SRC_0;
+               alu.src[1].chan = 0;
+               alu.last = 1;
+    }
+
+    if (push_modifier) {
+        alu.pred_sel = 0;
+               alu.execute_mask = 1;
+               r600_bytecode_add_alu_type(ctx->bc, &alu, 
CTX_INST(V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU_PUSH_BEFORE));
+       } else
+               r600_bytecode_add_alu(ctx->bc, &alu);
+
 
        /* XXX: Handle other KILL instructions */
        if (alu.inst == CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLGT)) {
@@ -329,16 +350,6 @@ static unsigned r600_alu_from_byte_stream(struct 
r600_shader_ctx *ctx,
 static void llvm_if(struct r600_shader_ctx *ctx, struct r600_bytecode_alu * 
alu,
        unsigned pred_inst)
 {
-       alu->inst = pred_inst; 
-       alu->execute_mask = 1;
-       alu->update_pred = 1;
-       alu->dst.write = 0;
-       alu->src[1].sel = V_SQ_ALU_SRC_0;
-       alu->src[1].chan = 0;
-       alu->last = 1;
-       r600_bytecode_add_alu_type(ctx->bc, alu,
-               CTX_INST(V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU_PUSH_BEFORE));
-
        r600_bytecode_add_cfinst(ctx->bc, 
CTX_INST(V_SQ_CF_WORD1_SQ_CF_INST_JUMP));
        fc_pushlevel(ctx, FC_IF);
        callstack_check_depth(ctx, FC_PUSH_VPM, 0);

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to