From aab81d660af063aa7fbf22399a9897be9ab78652 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Wed, 5 Oct 2022 18:27:02 +0200 Subject: [PATCH] freedreno: Make BIT() 64-bit In turnip we were using this a lot with the dynamic state enum, and we're running out of space there because we're needing to add more and more dynamic states that don't correspond to draw states. Make it 64-bit-safe so we don't need to rewrite everything in turnip. In the case where the thing being operated on is 32-bit the compiler can usually optimize it away, as can be seen with the release build size before and after: before: text data bss dec hex filename 5404913 293592 22744 5721249 574ca1 /home/cwabbott/build/mesa-release/lib64/libvulkan_freedreno.so text data bss dec hex filename 13981320 498550 205000 14684870 e012c6 /home/cwabbott/build/mesa-release/lib64/dri/msm_dri.so after: text data bss dec hex filename 5404969 293592 22744 5721305 574cd9 /home/cwabbott/build/mesa-release/lib64/libvulkan_freedreno.so text data bss dec hex filename 13981320 498550 205000 14684870 e012c6 /home/cwabbott/build/mesa-release/lib64/dri/msm_dri.so In the end the only changes is an additional ~50 bytes of text in turnip. Part-of: --- src/freedreno/common/freedreno_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/freedreno/common/freedreno_common.h b/src/freedreno/common/freedreno_common.h index 667157b..7b1674e 100644 --- a/src/freedreno/common/freedreno_common.h +++ b/src/freedreno/common/freedreno_common.h @@ -54,6 +54,6 @@ /* for conditionally setting boolean flag(s): */ #define COND(bool, val) ((bool) ? (val) : 0) -#define BIT(bit) BITFIELD_BIT(bit) +#define BIT(bit) BITFIELD64_BIT(bit) #endif /* FREEDRENO_COMMON_H_ */ -- 2.7.4