[Mesa-dev] [PATCH 1/6] gallium: document PK2H/UP2H
Roland Scheidegger
sroland at vmware.com
Sun Jan 3 09:33:29 PST 2016
Am 03.01.2016 um 01:37 schrieb Ilia Mirkin:
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
> src/gallium/docs/source/tgsi.rst | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst
> index 955ece8..f69998f 100644
> --- a/src/gallium/docs/source/tgsi.rst
> +++ b/src/gallium/docs/source/tgsi.rst
> @@ -458,7 +458,9 @@ while DDY is allowed to be the same for the entire 2x2 quad.
>
> .. opcode:: PK2H - Pack Two 16-bit Floats
>
> - TBD
> +.. math::
> +
> + dst.x = f32\_to\_f16(src.x) | f32\_to\_f16(src.y) << 16
This doesn't quite match the tgsi info description (which says that the
result is
replicated). If you don't want channel replication probably should make
that CHAN
there instead.
>
> .. opcode:: PK2US - Pack Two Unsigned 16-bit Scalars
> @@ -615,7 +617,11 @@ This instruction replicates its result.
>
> .. opcode:: UP2H - Unpack Two 16-Bit Floats
>
> - TBD
> +.. math::
> +
> + dst.x = f16\_to\_f32(src0.x \& 0xffff)
> +
> + dst.y = f16\_to\_f32(src0.x >> 16)
>
I'm certainly ok with that, albeit (just like PK2H unless you do
replication) it's not what the original source for this opcode does
(which would have been NV_fragment_program).
For the series (with the first point addressed either way,though a tgsi
exec implementation which should be trivial wouldn't hurt neither)
Reviewed-by: Roland Scheidegger <sroland at vmware.com>
More information about the mesa-dev
mailing list