[Mesa-dev] [PATCH 04/22] nir/opcodes: Make unpack_half_2x16_split_* variable-width

Kenneth Graunke kenneth at whitecape.org
Wed Aug 29 05:53:16 UTC 2018


On Friday, August 17, 2018 1:06:10 PM PDT Jason Ekstrand wrote:
> There is nothing inherent about these opcodes that requires them to only
> take scalars.  It's very convenient if we let them take vectors as well.
> ---
>  src/compiler/nir/nir_opcodes.py | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py
> index ed8e0ae9f39..4ef4ecc6f22 100644
> --- a/src/compiler/nir/nir_opcodes.py
> +++ b/src/compiler/nir/nir_opcodes.py
> @@ -304,10 +304,10 @@ unop_horiz("unpack_32_2x16", 2, tuint16, 1, tuint32,
>  # Lowered floating point unpacking operations.
>  
>  
> -unop_horiz("unpack_half_2x16_split_x", 1, tfloat32, 1, tuint32,
> -           "unpack_half_1x16((uint16_t)(src0.x & 0xffff))")
> -unop_horiz("unpack_half_2x16_split_y", 1, tfloat32, 1, tuint32,
> -           "unpack_half_1x16((uint16_t)(src0.x >> 16))")
> +unop_convert("unpack_half_2x16_split_x", tfloat32, tuint32,
> +             "unpack_half_1x16((uint16_t)(src0 & 0xffff))")
> +unop_convert("unpack_half_2x16_split_y", tfloat32, tuint32,
> +             "unpack_half_1x16((uint16_t)(src0 >> 16))")
>  
>  unop_convert("unpack_32_2x16_split_x", tuint16, tuint32, "src0")
>  unop_convert("unpack_32_2x16_split_y", tuint16, tuint32, "src0 >> 16")
> 

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180828/652829d1/attachment-0001.sig>


More information about the mesa-dev mailing list