[Mesa-dev] [PATCH 13/16] glsl: Add ir_binop_sub to get_range

Ian Romanick idr at freedesktop.org
Wed Nov 19 11:20:23 PST 2014


Same whitespace comments as patch 10.  With those fixed,

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

On 11/16/2014 05:51 PM, Thomas Helland wrote:
> ---
>  src/glsl/opt_minmax.cpp | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/src/glsl/opt_minmax.cpp b/src/glsl/opt_minmax.cpp
> index 0638a12..9d300d3 100644
> --- a/src/glsl/opt_minmax.cpp
> +++ b/src/glsl/opt_minmax.cpp
> @@ -335,6 +335,15 @@ get_range(ir_rvalue *rval)
>              high = add(r0.high, r1.high)->constant_expression_value();
>           return minmax_range(low, high);
>  
> +      case ir_binop_sub:
> +         r0 = get_range(expr->operands[0]);
> +         r1 = get_range(expr->operands[1]);
> +         if (r0.low && r1.high)
> +            low = sub(r0.low, r1.high)->constant_expression_value();
> +         if(r0.high && r1.low)
> +            high = sub(r0.high, r1.low)->constant_expression_value();
> +         return minmax_range(low, high);
> +
>        case ir_binop_pow:
>           r0 = get_range(expr->operands[0]);
>           if (is_greater_than_or_equal_zero(r0.low))
> 



More information about the mesa-dev mailing list