[Mesa-dev] [PATCH 07/11] intel/compiler: implement nir_instr_type_load_const for 16-bit constants

Jason Ekstrand jason at jlekstrand.net
Tue Apr 24 21:54:08 UTC 2018


Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

On Wed, Apr 11, 2018 at 12:20 AM, Iago Toral Quiroga <itoral at igalia.com>
wrote:

> From: Jose Maria Casanova Crespo <jmcasanova at igalia.com>
>
> ---
>  src/intel/compiler/brw_fs_nir.cpp | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/src/intel/compiler/brw_fs_nir.cpp
> b/src/intel/compiler/brw_fs_nir.cpp
> index ad31f7c82dc..822a1ac4227 100644
> --- a/src/intel/compiler/brw_fs_nir.cpp
> +++ b/src/intel/compiler/brw_fs_nir.cpp
> @@ -1509,6 +1509,11 @@ fs_visitor::nir_emit_load_const(const fs_builder
> &bld,
>     fs_reg reg = bld.vgrf(reg_type, instr->def.num_components);
>
>     switch (instr->def.bit_size) {
> +   case 16:
> +      for (unsigned i = 0; i < instr->def.num_components; i++)
> +         bld.MOV(offset(reg, bld, i), brw_imm_w(instr->value.i16[i]));
> +      break;
> +
>     case 32:
>        for (unsigned i = 0; i < instr->def.num_components; i++)
>           bld.MOV(offset(reg, bld, i), brw_imm_d(instr->value.i32[i]));
> --
> 2.14.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180424/5f3479f7/attachment-0001.html>


More information about the mesa-dev mailing list