From 81692b6d2c2796be1ff667b0e8a530bdd0d3817f Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 29 Dec 2020 16:56:23 -0500 Subject: [PATCH] pan/bi: Add "word equivalence" relation for index Takes offset *but not swizzle* into account, so the scheduler can predict whether indices will end up mapped to the same scalar register. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/bifrost/compiler.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 20550bd0067..41e57ded710 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -232,6 +232,16 @@ bi_is_equiv(bi_index left, bi_index right) (left.value == right.value); } +/* A stronger equivalence relation that requires the indices access the + * same offset, useful for RA/scheduling to see what registers will + * correspond to */ + +static inline bool +bi_is_word_equiv(bi_index left, bi_index right) +{ + return bi_is_equiv(left, right) && left.offset == right.offset; +} + #define BI_MAX_DESTS 2 #define BI_MAX_SRCS 4