assert(intel->gen == 6);
gen6_IF(p, inst->conditional_mod, src[0], src[1]);
} else {
- brw_IF(p, BRW_EXECUTE_8);
+ struct brw_instruction *brw_inst = brw_IF(p, BRW_EXECUTE_8);
+ brw_inst->header.predicate_control = inst->predicate;
}
if_depth_in_loop[loop_stack_depth]++;
break;
assert(expr->get_num_operands() <= 2);
for (unsigned int i = 0; i < expr->get_num_operands(); i++) {
- assert(expr->operands[i]->type->is_scalar());
+ assert(expr->operands[i]->type->is_scalar() ||
+ expr->operation == ir_binop_any_nequal ||
+ expr->operation == ir_binop_all_equal);
expr->operands[i]->accept(this);
op[i] = this->result;
case ir_binop_less:
case ir_binop_lequal:
case ir_binop_equal:
- case ir_binop_all_equal:
case ir_binop_nequal:
- case ir_binop_any_nequal:
inst = emit(BRW_OPCODE_IF, dst_null_d(), op[0], op[1]);
inst->conditional_mod =
brw_conditional_for_comparison(expr->operation);
return;
+
+ case ir_binop_all_equal:
+ inst = emit(BRW_OPCODE_CMP, dst_null_d(), op[0], op[1]);
+ inst->conditional_mod = BRW_CONDITIONAL_Z;
+
+ inst = emit(BRW_OPCODE_IF);
+ inst->predicate = BRW_PREDICATE_ALIGN16_ALL4H;
+ return;
+
+ case ir_binop_any_nequal:
+ inst = emit(BRW_OPCODE_CMP, dst_null_d(), op[0], op[1]);
+ inst->conditional_mod = BRW_CONDITIONAL_NZ;
+
+ inst = emit(BRW_OPCODE_IF);
+ inst->predicate = BRW_PREDICATE_ALIGN16_ANY4H;
+ return;
+
default:
assert(!"not reached");
inst = emit(BRW_OPCODE_IF, dst_null_d(), op[0], src_reg(0));