r600g/sb: optimize some cases for CNDxx instructions
authorVadim Girlin <vadimgirlin@gmail.com>
Sun, 5 May 2013 02:03:14 +0000 (06:03 +0400)
committerVadim Girlin <vadimgirlin@gmail.com>
Tue, 7 May 2013 00:40:26 +0000 (04:40 +0400)
commitc9cf83b587fbc679df5ed445bfa12f3227f68a6f
tree8fddfeeef7ec05fbf69ca5b825da288f786ab727
parent46dfad8b36dda80982613a9d29b9a7e99db3abfb
r600g/sb: optimize some cases for CNDxx instructions

We can replace CNDxx with MOV (and possibly eliminate after
propagation) in following cases:

If src1 is equal to src2 in CNDxx instruction then the result doesn't
depend on condition and we can replace the instruction with
"MOV dst, src1".

If src0 is const then we can evaluate the condition at compile time and
also replace it with MOV.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
src/gallium/drivers/r600/sb/sb_expr.cpp
src/gallium/drivers/r600/sb/sb_expr.h