glsl: define gl_LightSource members in ARB_vertex_program order
[mesa.git] / src / compiler / glsl / lower_int64.cpp
index 4e2e311e02de8f6391efe3984b8752af7d7ef71a..43774d6ab334d9ba8d8f0546ea3852402c5402fd 100644 (file)
@@ -69,11 +69,11 @@ namespace {
 class lower_64bit_visitor : public ir_rvalue_visitor {
 public:
    lower_64bit_visitor(void *mem_ctx, exec_list *instructions, unsigned lower)
-      : progress(false), lower(lower), instructions(instructions),
+      : progress(false), lower(lower),
         function_list(), added_functions(&function_list, mem_ctx)
    {
       functions = _mesa_hash_table_create(mem_ctx,
-                                          _mesa_key_hash_string,
+                                          _mesa_hash_string,
                                           _mesa_key_string_equal);
 
       foreach_in_list(ir_instruction, node, instructions) {
@@ -111,8 +111,6 @@ public:
 private:
    unsigned lower; /** Bitfield of which operations to lower */
 
-   exec_list *instructions;
-
    /** Hashtable containing all of the known functions in the IR */
    struct hash_table *functions;
 
@@ -258,7 +256,7 @@ lower_64bit::lower_op_to_function_call(ir_instruction *base_ir,
                                        ir_expression *ir,
                                        ir_function_signature *callee)
 {
-   const unsigned num_operands = ir->get_num_operands();
+   const unsigned num_operands = ir->num_operands;
    ir_variable *src[4][4];
    ir_variable *dst[4];
    void *const mem_ctx = ralloc_parent(ir);
@@ -319,7 +317,7 @@ lower_64bit_visitor::handle_op(ir_expression *ir,
                                const char *function_name,
                                function_generator generator)
 {
-   for (unsigned i = 0; i < ir->get_num_operands(); i++)
+   for (unsigned i = 0; i < ir->num_operands; i++)
       if (!ir->operands[i]->type->is_integer_64())
          return ir;
 
@@ -341,6 +339,7 @@ lower_64bit_visitor::handle_op(ir_expression *ir,
       add_function(f);
    }
 
+   this->progress = true;
    return lower_op_to_function_call(this->base_ir, ir, callee);
 }
 
@@ -357,7 +356,6 @@ lower_64bit_visitor::handle_rvalue(ir_rvalue **rvalue)
    case ir_unop_sign:
       if (lowering(SIGN64)) {
          *rvalue = handle_op(ir, "__builtin_sign64", generate_ir::sign64);
-         this->progress = true;
       }
       break;
 
@@ -368,7 +366,6 @@ lower_64bit_visitor::handle_rvalue(ir_rvalue **rvalue)
          } else {
             *rvalue = handle_op(ir, "__builtin_idiv64", generate_ir::idiv64);
          }
-         this->progress = true;
       }
       break;
 
@@ -379,14 +376,12 @@ lower_64bit_visitor::handle_rvalue(ir_rvalue **rvalue)
          } else {
             *rvalue = handle_op(ir, "__builtin_imod64", generate_ir::imod64);
          }
-         this->progress = true;
       }
       break;
 
    case ir_binop_mul:
       if (lowering(MUL64)) {
          *rvalue = handle_op(ir, "__builtin_umul64", generate_ir::umul64);
-         this->progress = true;
       }
       break;