[Mesa-dev] [PATCH 3/8] glsl/ir_builder: Add rcp builder.

Ian Romanick idr at freedesktop.org
Wed Jan 25 00:48:57 UTC 2017


This patch is

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

Next time someone asks for a newbie task, we should have ir_builder be
generated from ir_expression_operation.py.

On 01/24/2017 03:26 PM, Francisco Jerez wrote:
> ---
>  src/compiler/glsl/ir_builder.cpp | 6 ++++++
>  src/compiler/glsl/ir_builder.h   | 1 +
>  2 files changed, 7 insertions(+)
> 
> diff --git a/src/compiler/glsl/ir_builder.cpp b/src/compiler/glsl/ir_builder.cpp
> index 0cee856..8d61533 100644
> --- a/src/compiler/glsl/ir_builder.cpp
> +++ b/src/compiler/glsl/ir_builder.cpp
> @@ -315,6 +315,12 @@ exp(operand a)
>  }
>  
>  ir_expression *
> +rcp(operand a)
> +{
> +   return expr(ir_unop_rcp, a);
> +}
> +
> +ir_expression *
>  rsq(operand a)
>  {
>     return expr(ir_unop_rsq, a);
> diff --git a/src/compiler/glsl/ir_builder.h b/src/compiler/glsl/ir_builder.h
> index 5ee9412..ff1ff70 100644
> --- a/src/compiler/glsl/ir_builder.h
> +++ b/src/compiler/glsl/ir_builder.h
> @@ -148,6 +148,7 @@ ir_expression *neg(operand a);
>  ir_expression *sin(operand a);
>  ir_expression *cos(operand a);
>  ir_expression *exp(operand a);
> +ir_expression *rcp(operand a);
>  ir_expression *rsq(operand a);
>  ir_expression *sqrt(operand a);
>  ir_expression *log(operand a);
> 



More information about the mesa-dev mailing list