[Mesa-dev] [PATCH 12/13] nir: add pack_double_2x32_split_y opcode

Samuel Iglesias Gonsálvez siglesias at igalia.com
Mon Apr 25 07:03:59 UTC 2016


Please discard this patch and the following one ("[PATCH 13/13]
nir/lower_double_ops: optimize set_exponent()"). We have moved this to
i965 backend.

Sam

On 12/04/16 10:05, Samuel Iglesias Gonsálvez wrote:
> From: Iago Toral Quiroga <itoral at igalia.com>
> 
> This is useful when we only need to modify the high 32-bit chunk of a double.
> This is a common case, because this is the part that encodes the exponent
> which we manipulate in some double lowering passes. Although we can accomplish
> the same by using pack_double_2x32, this new opcode is better for register
> pressure, since we don't have to unpack both parts of the double and keep
> the low 32-bits around until we can recombine the new exponent.
> 
> We will use this opcode in the set_exponent() function of the double lowering
> pass and with that we will fix spilling issues in some dmat4 divide
> piglit tests on Intel.
> ---
>  src/compiler/nir/nir_opcodes.py | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py
> index 9f62e08..f92dd8d 100644
> --- a/src/compiler/nir/nir_opcodes.py
> +++ b/src/compiler/nir/nir_opcodes.py
> @@ -276,6 +276,20 @@ di.i2 = src0.y;
>  dst.x = di.u64;
>  """)
>  
> +opcode("pack_double_2x32_split_y", 0, tuint64, [0, 0], [tuint64, tuint32], "", """
> +union {
> +    uint64_t u64;
> +    struct {
> +        uint32_t i1;
> +        uint32_t i2;
> +    };
> +} di;
> +
> +di.u64 = src0;
> +di.i1 = src1;
> +dst = di.u64;
> +""")
> +
>  unop_horiz("unpack_double_2x32", 2, tuint32, 1, tuint64, """
>  union {
>      uint64_t u64;
> 


More information about the mesa-dev mailing list