From: Alyssa Rosenzweig Date: Thu, 15 Aug 2019 14:03:35 +0000 (-0700) Subject: pan/bifrost: Manually constant fold register class X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=78eda70892ebaa03e2c1d87cceb386828a1ce64b;p=mesa.git pan/bifrost: Manually constant fold register class Fixes errors for some people building Mesa: ../src/panfrost/bifrost/bifrost_sched.c:32:31: error: initializer element is not constant const unsigned max_vec2_reg = max_primary_reg / 2; ../src/panfrost/bifrost/bifrost_sched.c:33:31: error: initializer element is not constant const unsigned max_vec3_reg = max_primary_reg / 4; // XXX: Do we need to align vec3 to vec4 boundary? ../src/panfrost/bifrost/bifrost_sched.c:34:31: error: initializer element is not constant const unsigned max_vec4_reg = max_primary_reg / 4; ../src/panfrost/bifrost/bifrost_sched.c:35:32: error: initializer element is not constant const unsigned max_registers = max_primary_reg + ../src/panfrost/bifrost/bifrost_sched.c:40:28: error: initializer element is not constant const unsigned vec2_base = primary_base + max_primary_reg; ../src/panfrost/bifrost/bifrost_sched.c:41:28: error: initializer element is not constant const unsigned vec3_base = vec2_base + max_vec2_reg; ../src/panfrost/bifrost/bifrost_sched.c:42:28: error: initializer element is not constant const unsigned vec4_base = vec3_base + max_vec3_reg; ../src/panfrost/bifrost/bifrost_sched.c:43:27: error: initializer element is not constant const unsigned vec4_end = vec4_base + max_vec4_reg; Signed-off-by: Alyssa Rosenzweig --- diff --git a/src/panfrost/bifrost/bifrost_sched.c b/src/panfrost/bifrost/bifrost_sched.c index 3432cb35241..f9629f8f957 100644 --- a/src/panfrost/bifrost/bifrost_sched.c +++ b/src/panfrost/bifrost/bifrost_sched.c @@ -28,19 +28,16 @@ #include "bifrost_print.h" #define BI_DEBUG -const unsigned max_primary_reg = 64; // XXX: Not correct since there are special ones in the top end -const unsigned max_vec2_reg = max_primary_reg / 2; -const unsigned max_vec3_reg = max_primary_reg / 4; // XXX: Do we need to align vec3 to vec4 boundary? -const unsigned max_vec4_reg = max_primary_reg / 4; -const unsigned max_registers = max_primary_reg + - max_vec2_reg + - max_vec3_reg + - max_vec4_reg; +const unsigned max_primary_reg = 64; /* Overestimate because of special regs */ +const unsigned max_vec2_reg = 32; +const unsigned max_vec3_reg = 16; // XXX: Do we need to align vec3 to vec4 boundary? +const unsigned max_vec4_reg = 16; +const unsigned max_registers = 128; /* Sum of classes */ const unsigned primary_base = 0; -const unsigned vec2_base = primary_base + max_primary_reg; -const unsigned vec3_base = vec2_base + max_vec2_reg; -const unsigned vec4_base = vec3_base + max_vec3_reg; -const unsigned vec4_end = vec4_base + max_vec4_reg; +const unsigned vec2_base = 64; +const unsigned vec3_base = 96; /* above base + max_class_reg */ +const unsigned vec4_base = 112; +const unsigned vec4_end = 128; static unsigned find_or_allocate_temp(compiler_context *ctx, unsigned hash)