From 655cb9c61fd24caec0146dba5e6e1ba4f0b54937 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 28 Feb 2024 05:34:16 -0800 Subject: [PATCH] intel/brw: Delete some swizzling functions Not needed in the align1 world, apparently. Reviewed-by: Caio Oliveira Part-of: --- src/intel/compiler/brw_reg.h | 57 ------------------------------------ 1 file changed, 57 deletions(-) diff --git a/src/intel/compiler/brw_reg.h b/src/intel/compiler/brw_reg.h index 4f1bcc6b899..8e610a671c6 100644 --- a/src/intel/compiler/brw_reg.h +++ b/src/intel/compiler/brw_reg.h @@ -119,41 +119,6 @@ brw_compose_swizzle(unsigned swz0, unsigned swz1) BRW_GET_SWZ(swz1, BRW_GET_SWZ(swz0, 3))); } -/** - * Return the result of applying swizzle \p swz to shuffle the bits of \p mask - * (AKA image). - */ -static inline unsigned -brw_apply_swizzle_to_mask(unsigned swz, unsigned mask) -{ - unsigned result = 0; - - for (unsigned i = 0; i < 4; i++) { - if (mask & (1 << BRW_GET_SWZ(swz, i))) - result |= 1 << i; - } - - return result; -} - -/** - * Return the result of applying the inverse of swizzle \p swz to shuffle the - * bits of \p mask (AKA preimage). Useful to find out which components are - * read from a swizzled source given the instruction writemask. - */ -static inline unsigned -brw_apply_inv_swizzle_to_mask(unsigned swz, unsigned mask) -{ - unsigned result = 0; - - for (unsigned i = 0; i < 4; i++) { - if (mask & (1 << i)) - result |= 1 << BRW_GET_SWZ(swz, i); - } - - return result; -} - /** * Construct an identity swizzle for the set of enabled channels given by \p * mask. The result will only reference channels enabled in the provided \p @@ -179,28 +144,6 @@ brw_swizzle_for_mask(unsigned mask) return BRW_SWIZZLE4(swz[0], swz[1], swz[2], swz[3]); } -/** - * Construct an identity swizzle for the first \p n components of a vector. - * When only a subset of channels of a vec4 are used we don't want to - * reference the other channels, as that will tell optimization passes that - * those other channels are used. - */ -static inline unsigned -brw_swizzle_for_size(unsigned n) -{ - return brw_swizzle_for_mask((1 << n) - 1); -} - -/** - * Converse of brw_swizzle_for_mask(). Returns the mask of components - * accessed by the specified swizzle \p swz. - */ -static inline unsigned -brw_mask_for_swizzle(unsigned swz) -{ - return brw_apply_inv_swizzle_to_mask(swz, ~0); -} - uint32_t brw_swizzle_immediate(enum brw_reg_type type, uint32_t x, unsigned swz); #define REG_SIZE (8*4)