freedreno/registers: Add c++ magic for register variants
authorRob Clark <robdclark@chromium.org>
Thu, 2 Mar 2023 19:18:05 +0000 (11:18 -0800)
committerMarge Bot <emma+marge@anholt.net>
Mon, 13 Mar 2023 17:31:24 +0000 (17:31 +0000)
commitdc43237d1a845bbb357b59287c1ffff3d989adb3
tree59233a9896ba17233b1ea6feafcd6f6c46ed6f1a
parentd58af7b5c7fe8c9b6d191155e46d0a9d7b45cb3c
freedreno/registers: Add c++ magic for register variants

For regs with multiple variants, generate a template'ized function to
pack the reg value.  If the template param is known at compile time
(which is the expected usage) this will optimize to the same thing as
the "traditional" reg packing.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
src/freedreno/registers/gen_header.py