i965: Update expression splitting for the vector-result change to compares.
authorEric Anholt <eric@anholt.net>
Wed, 22 Sep 2010 21:52:38 +0000 (14:52 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 22 Sep 2010 21:55:58 +0000 (14:55 -0700)
Fixes:
glsl1-precision exp2
glsl1-precision log2

src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp

index eba8a764e21d973630aae32835f7137fea7f6d08..9fbf7b7c6b885da13309b850694d02808a1212a0 100644 (file)
@@ -119,7 +119,6 @@ ir_channel_expressions_visitor::assign(ir_assignment *ir, int elem, ir_rvalue *v
 {
    ir_dereference *lhs = ir->lhs->clone(mem_ctx, NULL);
    ir_assignment *assign;
-   ir_swizzle *val_swiz;
 
    /* This assign-of-expression should have been generated by the
     * expression flattening visitor (since we never short circit to
@@ -232,6 +231,12 @@ ir_channel_expressions_visitor::visit_leave(ir_assignment *ir)
    case ir_binop_bit_and:
    case ir_binop_bit_xor:
    case ir_binop_bit_or:
+   case ir_binop_less:
+   case ir_binop_greater:
+   case ir_binop_lequal:
+   case ir_binop_gequal:
+   case ir_binop_equal:
+   case ir_binop_nequal:
       for (i = 0; i < vector_elements; i++) {
         ir_rvalue *op0 = get_element(op_var[0], i);
         ir_rvalue *op1 = get_element(op_var[1], i);
@@ -312,10 +317,6 @@ ir_channel_expressions_visitor::visit_leave(ir_assignment *ir)
       break;
    }
 
-   case ir_binop_less:
-   case ir_binop_greater:
-   case ir_binop_lequal:
-   case ir_binop_gequal:
    case ir_binop_logic_and:
    case ir_binop_logic_xor:
    case ir_binop_logic_or:
@@ -323,8 +324,8 @@ ir_channel_expressions_visitor::visit_leave(ir_assignment *ir)
       printf("\n");
       assert(!"not reached: expression operates on scalars only");
       break;
-   case ir_binop_equal:
-   case ir_binop_nequal: {
+   case ir_binop_all_equal:
+   case ir_binop_any_nequal: {
       ir_expression *last = NULL;
       for (i = 0; i < vector_elements; i++) {
         ir_rvalue *op0 = get_element(op_var[0], i);
@@ -332,7 +333,7 @@ ir_channel_expressions_visitor::visit_leave(ir_assignment *ir)
         ir_expression *temp;
         ir_expression_operation join;
 
-        if (expr->operation == ir_binop_equal)
+        if (expr->operation == ir_binop_all_equal)
            join = ir_binop_logic_and;
         else
            join = ir_binop_logic_or;