From: Alyssa Rosenzweig Date: Thu, 31 Oct 2019 18:57:54 +0000 (-0400) Subject: pan/midgard: Extend default_phys_reg to !32-bit X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=12d071024b13593e9cc4149d0420946cbd7d869f;p=mesa.git pan/midgard: Extend default_phys_reg to !32-bit We can pass through a size. Signed-off-by: Alyssa Rosenzweig --- diff --git a/src/panfrost/midgard/midgard_ra.c b/src/panfrost/midgard/midgard_ra.c index 87eedfd7c2e..2589aa5f41a 100644 --- a/src/panfrost/midgard/midgard_ra.c +++ b/src/panfrost/midgard/midgard_ra.c @@ -98,12 +98,12 @@ offset_swizzle(unsigned *swizzle, unsigned reg_offset, unsigned srcsize, unsigne /* Helper to return the default phys_reg for a given register */ static struct phys_reg -default_phys_reg(int reg) +default_phys_reg(int reg, midgard_reg_mode size) { struct phys_reg r = { .reg = reg, .offset = 0, - .size = 4 + .size = mir_bytes_for_mode(size) }; return r; @@ -117,11 +117,11 @@ index_to_reg(compiler_context *ctx, struct ra_graph *g, unsigned reg, midgard_re { /* Check for special cases */ if (reg == ~0) - return default_phys_reg(REGISTER_UNUSED); + return default_phys_reg(REGISTER_UNUSED, size); else if (reg >= SSA_FIXED_MINIMUM) - return default_phys_reg(SSA_REG_FROM_FIXED(reg)); + return default_phys_reg(SSA_REG_FROM_FIXED(reg), size); else if (!g) - return default_phys_reg(REGISTER_UNUSED); + return default_phys_reg(REGISTER_UNUSED, size); /* Special cases aside, we pick the underlying register */ int virt = ra_get_node_reg(g, reg);