glsl: Generate code for constant ir_binop_lshift and ir_binop_rshift expressions
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 12 Jul 2016 18:29:21 +0000 (11:29 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 30 Aug 2016 23:28:02 +0000 (16:28 -0700)
commit13106e1041c254a80c7e2df392efea93dcbb215f
treef2cd08f1ac9687e0eb5eb6f2ed9adf39541a0f0f
parent90da8bf5477cb65b9f2e5148c05ef621a09b704f
glsl: Generate code for constant ir_binop_lshift and ir_binop_rshift expressions

The code generated is quite different from what was previously used.  I
believe that it is still correct by the GLSL spec, and I believe, due to
C rules about shifts, the behavior will be the same.

Section 5.9 (Expressions) of the GLSL 4.50 spec says:

    The result is undefined if the right operand is negative, or greater
    than or equal to the number of bits in the left expression's base
    type.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Dylan Baker <dylan@pnwbakers.com>
src/compiler/glsl/ir_expression_operation.py