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 <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5151>
This commit is contained in:
Alyssa Rosenzweig 2020-05-11 15:05:27 -04:00 committed by Marge Bot
parent 51582e5454
commit 1ff2cabe87

View file

@ -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;