tgsi_exec: Fix NaN behavior of min and max
Modern shader APIs, like DX10 and GLSL 1.30, want min() and max() to
"cleanse" NaN. If one source is NaN, the other value should be chosen.
If both sources are NaN, the result may be either.
There are many cases where TGSI is generate from NIR, and many
optimizations in NIR expect this behavior. Not meeting these
expectations can lead to unexpected results.
Reviewed-by: Eric Anholt <eric@anholt.net>
Fixes:
ffe58739da9 ("Softpipe: import TGSI tree. Not hooked-up yet.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10419>