using namespace brw;
+#define REG_CLASS_COUNT 20
+
namespace brw {
static void
* SEND-from-GRF sources cannot be split, so we also need classes for each
* potential message length.
*/
- const int class_count = MAX_VGRF_SIZE;
- int class_sizes[MAX_VGRF_SIZE];
+ assert(REG_CLASS_COUNT == MAX_VGRF_SIZE);
+ int class_sizes[REG_CLASS_COUNT];
- for (int i = 0; i < class_count; i++)
+ for (int i = 0; i < REG_CLASS_COUNT; i++)
class_sizes[i] = i + 1;
if (compiler->devinfo->ver >= 6)
ra_set_allocate_round_robin(compiler->vec4_reg_set.regs);
ralloc_free(compiler->vec4_reg_set.classes);
- compiler->vec4_reg_set.classes = ralloc_array(compiler, struct ra_class *, class_count);
+ compiler->vec4_reg_set.classes = ralloc_array(compiler, struct ra_class *, REG_CLASS_COUNT);
/* Now, add the registers to their classes, and add the conflicts
* between them and the base GRF registers (and also each other).
*/
- for (int i = 0; i < class_count; i++) {
+ for (int i = 0; i < REG_CLASS_COUNT; i++) {
int class_reg_count = base_reg_count - (class_sizes[i] - 1);
compiler->vec4_reg_set.classes[i] =
ra_alloc_contig_reg_class(compiler->vec4_reg_set.regs, class_sizes[i]);