nir: i32csel opcodes should compare with integer zero

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Noticed-by: Georg Lehmann <dadschoorse@gmail.com>
Fixes: 0f5b3c37c5 ("nir: Add opcodes for fused comp + csel and optimizations")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17048>
This commit is contained in:
Ian Romanick 2022-06-15 09:21:10 -07:00 committed by Marge Bot
parent d455838081
commit ccd18ec4f3

View file

@ -1019,8 +1019,8 @@ opcode("b16csel", 0, tuint, [0, 0, 0],
opcode("b32csel", 0, tuint, [0, 0, 0],
[tbool32, tuint, tuint], False, "", "src0 ? src1 : src2")
triop("i32csel_gt", tint32, "", "(src0 > 0.0f) ? src1 : src2")
triop("i32csel_ge", tint32, "", "(src0 >= 0.0f) ? src1 : src2")
triop("i32csel_gt", tint32, "", "(src0 > 0) ? src1 : src2")
triop("i32csel_ge", tint32, "", "(src0 >= 0) ? src1 : src2")
triop("fcsel_gt", tfloat32, "", "(src0 > 0.0f) ? src1 : src2")
triop("fcsel_ge", tfloat32, "", "(src0 >= 0.0f) ? src1 : src2")