r600g/sb: improve math optimizations v2
authorVadim Girlin <vadimgirlin@gmail.com>
Wed, 5 Jun 2013 16:55:31 +0000 (20:55 +0400)
committerVadim Girlin <vadimgirlin@gmail.com>
Thu, 11 Jul 2013 19:01:01 +0000 (23:01 +0400)
commit758ac6f91894c105c83a193e8f4f6ead06962949
tree0c9be721f446b258122706d1003d00374f362900
parentc451619dde9a510e5a2214f26c16ff28266b3018
r600g/sb: improve math optimizations v2

This patch adds support for some math optimizations that are generally
considered unsafe, that's why they are currently disabled for compute
shaders.

GL requirements are less strict, so they are enabled for
for GL shaders by default. In case of any issues with
applications that rely on higher precision than guaranteed by GL,
'sbsafemath' option in R600_DEBUG allows to disable them.

v2 - always set proper src vector size for transformed instructions
   - check for clamp modifier in the expr_handler::fold_assoc

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
src/gallium/drivers/r600/r600_isa.h
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/r600/sb/sb_bc.h
src/gallium/drivers/r600/sb/sb_bc_parser.cpp
src/gallium/drivers/r600/sb/sb_context.cpp
src/gallium/drivers/r600/sb/sb_core.cpp
src/gallium/drivers/r600/sb/sb_expr.cpp
src/gallium/drivers/r600/sb/sb_expr.h
src/gallium/drivers/r600/sb/sb_shader.cpp
src/gallium/drivers/r600/sb/sb_shader.h