[Mesa-dev] [PATCH] intel/compiler: Replicate 16 bit immediate value correctly

Matt Turner mattst88 at gmail.com
Tue Mar 26 23:46:00 UTC 2019


On Tue, Mar 26, 2019 at 3:35 PM Sagar Ghuge <sagar.ghuge at intel.com> wrote:
>
> For the W or UW (signed or unsigned word) source types, the 16-bit value
> must be replicated in both the low and high words of the 32-bit
> immediate value.
>
> Signed-off-by: Sagar Ghuge <sagar.ghuge at intel.com>
> ---
>  src/intel/compiler/brw_fs.cpp | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
> index 0c2439d9daf..f8cb91fcf21 100644
> --- a/src/intel/compiler/brw_fs.cpp
> +++ b/src/intel/compiler/brw_fs.cpp
> @@ -4069,6 +4069,9 @@ fs_visitor::lower_integer_multiplication()
>              mul->src[1].type = BRW_REGISTER_TYPE_UW;
>              mul->src[1].stride *= 2;
>
> +            if (mul->src[1].file == IMM)
> +               mul->src[1].ud = ((mul->src[1].ud & 0xffff) |
> +                                 mul->src[1].ud << 16);

Please put braces around the statement, since it's in nested control flow.

Reviewed-by: Matt Turner <mattst88 at gmail.com>


More information about the mesa-dev mailing list