summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-08-27 13:49:09 -0700
committerEric Anholt <[email protected]>2010-08-27 13:59:36 -0700
commit38d01c5b272d28a805e7598bad2f2ef5c8da732a (patch)
tree11b020adbb95281db9a1b59a47617ceabae74d63 /src/mesa/drivers
parent4229a93cc756b3ade02dcf93d806610f95497ad3 (diff)
i965: Mask out higher bits of the result of BRW_CMP producing a boolean.
When it says it sets the LSB, that's not just a hint as to where the result goes. Only the LSB is modified. Fixes 20 piglit cases.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 98d5d659408..3f41a553315 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -710,26 +710,32 @@ fs_visitor::visit(ir_expression *ir)
case ir_binop_less:
inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1]));
inst->conditional_mod = BRW_CONDITIONAL_L;
+ emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1)));
break;
case ir_binop_greater:
inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1]));
inst->conditional_mod = BRW_CONDITIONAL_G;
+ emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1)));
break;
case ir_binop_lequal:
inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1]));
inst->conditional_mod = BRW_CONDITIONAL_LE;
+ emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1)));
break;
case ir_binop_gequal:
inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1]));
inst->conditional_mod = BRW_CONDITIONAL_GE;
+ emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1)));
break;
case ir_binop_equal:
inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1]));
inst->conditional_mod = BRW_CONDITIONAL_Z;
+ emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1)));
break;
case ir_binop_nequal:
inst = emit(fs_inst(BRW_OPCODE_CMP, this->result, op[0], op[1]));
inst->conditional_mod = BRW_CONDITIONAL_NZ;
+ emit(fs_inst(BRW_OPCODE_AND, this->result, this->result, fs_reg(0x1)));
break;
case ir_binop_logic_xor: