[Mesa-dev] [PATCH] gallium/tgsi: clarify (possibly change) TGSI_OPCODE_UCMP definition
Christoph Bumiller
e0425955 at student.tuwien.ac.at
Wed May 8 03:14:19 PDT 2013
On 08.05.2013 03:48, sroland at vmware.com wrote:
> From: Roland Scheidegger <sroland at vmware.com>
>
> UCMP while an integer opcode isn't really consistently implemented as
> having all integer arguments. softpipe will assume all arguments are
> ints, whereas gallivm has the arguments defined as untyped which
> means they'll get treated as floats. This means input modifiers will
> not work the same. Fix this by saying only first arg is an integer,
> which seems more useful than making all arguments integers - this would
> be similar to d3d10 movc opcode.
> ---
> src/gallium/docs/source/tgsi.rst | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst
> index 3af1fb7..852f8a0 100644
> --- a/src/gallium/docs/source/tgsi.rst
> +++ b/src/gallium/docs/source/tgsi.rst
> @@ -1291,6 +1291,11 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
>
> .. opcode:: UCMP - Integer Conditional Move
>
> +.. note::
> +
> + Only the first source arg is an integer, the 2nd and 3rd ones are
> + considered floats (for input modifier purposes).
> +
As long as you patch up all the occurrences of
tgsi_opcode_infer_src_type and make it take an argument to identify the
source ...
I'd rather just forbid modifiers on moves, i.e. MOV and UCMP, since at
least MOV returns TGSI_TYPE_UNTYPED and untyped values can't be operated on.
For the ordinary MOV we have NEG and ABS, and for UCMP the backend
optimizer can take care of merging modifiers into the instruction
(nvc0's UCMP (slct u32) doesn't support modifiers).
> .. math::
>
> dst.x = src0.x ? src1.x : src2.x
>
More information about the mesa-dev
mailing list