[Mesa-dev] [PATCH 01/15] glsl: Add new fma built-in IR and prototype from ARB_gpu_shader5.

Ian Romanick idr at freedesktop.org
Mon Aug 26 17:54:44 PDT 2013


The fma patches (patches 1 through 4) are all

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

I haven't quite made my way all the way through the rest.

On 08/22/2013 04:08 PM, Matt Turner wrote:
> ---
>   src/glsl/builtins/ir/fma.ir                     | 29 +++++++++++++++++++++++++
>   src/glsl/builtins/profiles/ARB_gpu_shader5.glsl |  5 +++++
>   2 files changed, 34 insertions(+)
>   create mode 100644 src/glsl/builtins/ir/fma.ir
>
> diff --git a/src/glsl/builtins/ir/fma.ir b/src/glsl/builtins/ir/fma.ir
> new file mode 100644
> index 0000000..c369563
> --- /dev/null
> +++ b/src/glsl/builtins/ir/fma.ir
> @@ -0,0 +1,29 @@
> +((function fma
> +   (signature float
> +     (parameters
> +       (declare (in) float a)
> +       (declare (in) float b)
> +       (declare (in) float c))
> +     ((return (expression float fma (var_ref a) (var_ref b) (var_ref c)))))
> +
> +   (signature vec2
> +     (parameters
> +       (declare (in) vec2 a)
> +       (declare (in) vec2 b)
> +       (declare (in) vec2 c))
> +     ((return (expression vec2 fma (var_ref a) (var_ref b) (var_ref c)))))
> +
> +   (signature vec3
> +     (parameters
> +       (declare (in) vec3 a)
> +       (declare (in) vec3 b)
> +       (declare (in) vec3 c))
> +     ((return (expression vec3 fma (var_ref a) (var_ref b) (var_ref c)))))
> +
> +   (signature vec4
> +     (parameters
> +       (declare (in) vec4 a)
> +       (declare (in) vec4 b)
> +       (declare (in) vec4 c))
> +     ((return (expression vec4 fma (var_ref a) (var_ref b) (var_ref c)))))
> +))
> diff --git a/src/glsl/builtins/profiles/ARB_gpu_shader5.glsl b/src/glsl/builtins/profiles/ARB_gpu_shader5.glsl
> index 458300f..3f76283 100644
> --- a/src/glsl/builtins/profiles/ARB_gpu_shader5.glsl
> +++ b/src/glsl/builtins/profiles/ARB_gpu_shader5.glsl
> @@ -54,3 +54,8 @@ int   findMSB(uint  value);
>   ivec2 findMSB(uvec2 value);
>   ivec3 findMSB(uvec3 value);
>   ivec4 findMSB(uvec4 value);
> +
> +float fma(float a, float b, float c);
> +vec2  fma(vec2  a, vec2  b, vec2  c);
> +vec3  fma(vec3  a, vec3  b, vec3  c);
> +vec4  fma(vec4  a, vec4  b, vec4  c);
>



More information about the mesa-dev mailing list