} /* extern "C" */
#include "brw_vec4.h"
-#include "glsl/ir_print_visitor.h"
+#include "brw_vs.h"
using namespace brw;
}
}
-void
+bool
vec4_visitor::reg_allocate_trivial()
{
unsigned int hw_reg_mapping[this->virtual_grf_count];
if (prog_data->total_grf > max_grf) {
fail("Ran out of regs on trivial allocator (%d/%d)\n",
prog_data->total_grf, max_grf);
+ return false;
}
+
+ return true;
}
static void
brw->vs.ra_reg_to_grf = ralloc_array(brw, uint8_t, ra_reg_count);
ralloc_free(brw->vs.regs);
brw->vs.regs = ra_alloc_reg_set(brw, ra_reg_count);
+ if (brw->gen >= 6)
+ ra_set_allocate_round_robin(brw->vs.regs);
ralloc_free(brw->vs.classes);
brw->vs.classes = ralloc_array(brw, int, class_count + 1);
ra_set_finalize(brw->vs.regs, NULL);
}
-void
+bool
vec4_visitor::reg_allocate()
{
unsigned int hw_reg_mapping[virtual_grf_count];
/* Using the trivial allocator can be useful in debugging undefined
* register access as a result of broken optimization passes.
*/
- if (0) {
- reg_allocate_trivial();
- return;
- }
+ if (0)
+ return reg_allocate_trivial();
calculate_live_intervals();
spill_reg(reg);
}
ralloc_free(g);
- return;
+ return false;
}
/* Get the chosen virtual registers for each node, and map virtual
}
ralloc_free(g);
+
+ return true;
}
void
}
if (inst->dst.file == GRF && inst->dst.reg == spill_reg_nr) {
- dst_reg spill_reg = inst->dst;
- inst->dst.reg = virtual_grf_alloc(1);
-
- /* We don't want a swizzle when reading from the source; read the
- * whole register and use spill_reg's writemask to select which
- * channels to write.
- */
- src_reg temp = src_reg(inst->dst);
- temp.swizzle = BRW_SWIZZLE_XYZW;
- emit_scratch_write(inst, temp, spill_reg, spill_offset);
+ emit_scratch_write(inst, spill_offset);
}
}