microsoft/compiler: Fix large shifts
authorJesse Natalie <jenatali@microsoft.com>
Tue, 4 Apr 2023 20:41:10 +0000 (13:41 -0700)
committerMarge Bot <emma+marge@anholt.net>
Thu, 6 Apr 2023 22:08:28 +0000 (22:08 +0000)
commit6d5ff875d2b34d8fe8843665fcf1b39c2230d3e5
treefb7446d8369587f1629b8d048562f43e3262f0f0
parent4f56cede6deff561a8cfa3fe893cf085cb8b2f1c
microsoft/compiler: Fix large shifts

Unlike DXBC, DXIL's shift instructions don't have the implicit behavior
that they only take the 5 bits. This is observable if you try to have
DXC do a shift of a dynamic value, e.g. a constant buffer value, where
the compiler inserts the appropriate 'and' op. We need to do the same.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
src/microsoft/compiler/nir_to_dxil.c