mesa/st: don't use CMP / I2F for conditional assignments with native integers
authorRoland Scheidegger <sroland@vmware.com>
Fri, 5 Dec 2014 22:08:34 +0000 (23:08 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Sat, 6 Dec 2014 17:03:25 +0000 (18:03 +0100)
commitd8da6deceadf5e48201d848b7061dad17a5b7cac
tree7b7af19b59b8b2ead4ccbe2cdb7dc08be8cab551
parent6f2cf5f3d0764e096b6b099ef9dc7bc92047c3cb
mesa/st: don't use CMP / I2F for conditional assignments with native integers

The original idea was to optimize away the condition by integrating it directly
into the CMP instruction. However, with native integers this requires an extra
I2F instruction. It is also fishy because the negation used didn't really honor
ieee754 float comparison rules, not to mention the CMP instruction itself
(being pretty much a legacy instruction) doesn't really have defined special
float value behavior in any case.
So, use UCMP and adjust the code trying to optimize the condition away
accordingly (I have absolutely no idea if such conditions are actually hit
or would be translated away somewhere else already).

v2: cosmetic changes

No piglit regressions on llvmpipe.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp