freedreno: Make BIT() 64-bit
authorConnor Abbott <cwabbott0@gmail.com>
Wed, 5 Oct 2022 16:27:02 +0000 (18:27 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 3 Nov 2022 21:59:42 +0000 (21:59 +0000)
commitaab81d660af063aa7fbf22399a9897be9ab78652
treedf49c05d0ecba67a37b31485c082e75cec9c6215
parentc8c7154c2ecb6d8439cc941985bded3759b8334b
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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
src/freedreno/common/freedreno_common.h