nir: fix unpack_unorm_2x16/unpack_snorm_2x16 constant folding

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Backport-to: 25.0
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35255>
(cherry picked from commit 6852538ba0)
This commit is contained in:
Rhys Perry 2025-05-27 11:37:18 +01:00 committed by Eric Engestrom
parent e8c614b88e
commit fe597d9e53
2 changed files with 2 additions and 2 deletions

View file

@ -744,7 +744,7 @@
"description": "nir: fix unpack_unorm_2x16/unpack_snorm_2x16 constant folding",
"nominated": true,
"nomination_type": 4,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -366,7 +366,7 @@ dst.x |= ((uint32_t) pack_fmt_1x8(src0.w)) << 24;
def unpack_2x16(fmt):
unop_horiz("unpack_" + fmt + "_2x16", 2, tfloat32, 1, tuint32, """
dst.x = unpack_fmt_1x16((uint16_t)(src0.x & 0xffff));
dst.y = unpack_fmt_1x16((uint16_t)(src0.x << 16));
dst.y = unpack_fmt_1x16((uint16_t)(src0.x >> 16));
""".replace("fmt", fmt))
def unpack_4x8(fmt):