From 75d911f0ee712035901b96d0b1c44fff1304a3d9 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 24 Dec 2023 12:45:33 -0400 Subject: [PATCH] agx: add index size helper to replace the switches. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_compiler.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/asahi/compiler/agx_compiler.h b/src/asahi/compiler/agx_compiler.h index d9ee7b5411e..c95c6591d00 100644 --- a/src/asahi/compiler/agx_compiler.h +++ b/src/asahi/compiler/agx_compiler.h @@ -82,6 +82,12 @@ agx_channels(agx_index idx) return idx.channels_m1 + 1; } +static inline unsigned +agx_index_size_16(agx_index idx) +{ + return agx_size_align_16(idx.size) * agx_channels(idx); +} + static inline agx_index agx_get_vec_index(unsigned value, enum agx_size size, unsigned channels) {