From e364e110208a8f9f5676849d3dd1d450d6ce9304 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 21 Dec 2020 17:00:50 -0500 Subject: [PATCH] pan/bi: Add bi_{abs, neg} helpers Just conveniences. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/compiler.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index d57dd679356..d6d6955607a 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -504,6 +504,22 @@ bi_byte(bi_index idx, unsigned lane) return idx; } +static inline bi_index +bi_abs(bi_index idx) +{ + assert(idx.type != BI_INDEX_CONSTANT); + idx.abs = true; + return idx; +} + +static inline bi_index +bi_neg(bi_index idx) +{ + assert(idx.type != BI_INDEX_CONSTANT); + idx.neg ^= true; + return idx; +} + static inline bi_index bi_imm_u8(uint8_t imm) {