aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-05-11 15:05:27 -0400
committerMarge Bot <[email protected]>2020-05-21 17:49:14 +0000
commit1ff2cabe87601d95bf945339ee1b3ea4b4d8bc72 (patch)
treee16e344695ad901ac26d1ee3de8097028e02223a
parent51582e54541a35b4eddd7dab98d8f676bcc46c53 (diff)
pan/mdg: Use type size to determine alignment
Generally, f16 needs to be aligned to 16-bit, f32 to 32-bit, ... Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5151>
-rw-r--r--src/panfrost/midgard/midgard_ra.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/panfrost/midgard/midgard_ra.c b/src/panfrost/midgard/midgard_ra.c
index 52f6f11f0a0..95fd30ec337 100644
--- a/src/panfrost/midgard/midgard_ra.c
+++ b/src/panfrost/midgard/midgard_ra.c
@@ -519,9 +519,11 @@ allocate_registers(compiler_context *ctx, bool *spilled)
int dest = ins->dest;
found_class[dest] = MAX2(found_class[dest], bytes);
- /* XXX: Ensure swizzles align the right way with more LCRA constraints? */
- if (ins->type == TAG_ALU_4 && size != 32)
- min_alignment[dest] = 3; /* (1 << 3) = 8 */
+ min_alignment[dest] =
+ (size == 16) ? 1 : /* (1 << 1) = 2-byte */
+ (size == 32) ? 2 : /* (1 << 2) = 4-byte */
+ (size == 64) ? 3 : /* (1 << 3) = 8-byte */
+ 3; /* 8-bit todo */
if (ins->type == TAG_LOAD_STORE_4 && ins->load_64)
min_alignment[dest] = 3;