nir/large_constants: Add read/write_const_values helpers
authorFaith Ekstrand <faith.ekstrand@collabora.com>
Mon, 17 Jul 2023 17:07:07 +0000 (12:07 -0500)
committerMarge Bot <emma+marge@anholt.net>
Wed, 16 Aug 2023 23:36:29 +0000 (23:36 +0000)
commit8ec0fdf0178a72533e676da4d86e28b773d7f02a
tree86b4515f79564b509e7ec75cf8c2fe60c1c11daa
parent7456ee052344263d39ac2c58bf4e998067f5c31f
nir/large_constants: Add read/write_const_values helpers

The write helper is just pulling code we already have out into a helper
and flipping the order of the loop and the switch.  The read helper will
be useful in the next commit where we add small constant support.  This
keeps the two helpers right next to each other in the file where they're
easy to compare and we can ensure that they stay in sync.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9000>
src/compiler/nir/nir_opt_large_constants.c