i965/fs: Lower 32x32 bit multiplication on BXT.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_fs_vector_splitting.cpp
index 5ddd6e82e985e012d7d1d828f5e26e207db43750..96d4f375da2ef00a4728462d096f5b82b08bc35e 100644 (file)
  * behavior we want for the results of texture lookups, but probably not for
  */
 
-extern "C" {
 #include "main/core.h"
 #include "brw_context.h"
-}
 #include "glsl/ir.h"
 #include "glsl/ir_visitor.h"
 #include "glsl/ir_rvalue_visitor.h"
@@ -175,7 +173,7 @@ ir_vector_reference_visitor::visit_enter(ir_assignment *ir)
       return visit_continue_with_parent;
    }
    if (ir->lhs->as_dereference_variable() &&
-       is_power_of_two(ir->write_mask) &&
+       _mesa_is_pow_two(ir->write_mask) &&
        !ir->condition) {
       /* If we're writing just a channel, then channel-splitting the LHS is OK.
        */
@@ -312,7 +310,7 @@ ir_vector_splitting_visitor::visit_leave(ir_assignment *ir)
         break;
       default:
         ir->fprint(stderr);
-        assert(!"not reached: non-channelwise dereference of LHS.");
+        unreachable("not reached: non-channelwise dereference of LHS.");
       }
 
       ir->lhs = new(mem_ctx) ir_dereference_variable(lhs->components[elem]);
@@ -363,12 +361,17 @@ brw_do_vector_splitting(exec_list *instructions)
       entry->mem_ctx = ralloc_parent(entry->var);
 
       for (unsigned int i = 0; i < entry->var->type->vector_elements; i++) {
-        const char *name = ralloc_asprintf(mem_ctx, "%s_%c",
-                                           entry->var->name,
-                                           "xyzw"[i]);
+         char *const name = ir_variable::temporaries_allocate_names
+            ? ralloc_asprintf(mem_ctx, "%s_%c",
+                              entry->var->name,
+                              "xyzw"[i])
+            : NULL;
 
         entry->components[i] = new(entry->mem_ctx) ir_variable(type, name,
                                                                ir_var_temporary);
+
+         ralloc_free(name);
+
         entry->var->insert_before(entry->components[i]);
       }