gallivm/tgsi: fix src modifier fetching with non-float types.

Need to take the type into account. Also, if we want to allow
mov's with modifiers we need to pick a type (assume float).

v2: don't allow all modifiers on all type, in particular don't allow
absolute on non-float types and don't allow negate on unsigned.
Also treat UADD as signed (despite the name) since it is used
for handling both signed and unsigned integer arguments and otherwise
modifiers don't work.
Also add tgsi docs clarifying this.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
This commit is contained in:
Roland Scheidegger
2013-02-16 02:26:14 +01:00
parent c25ae5d27b
commit cb2e678294
4 changed files with 54 additions and 5 deletions

View File

@@ -23,6 +23,21 @@ When an instruction has a scalar result, the result is usually copied into
each of the components of *dst*. When this happens, the result is said to be
*replicated* to *dst*. :opcode:`RCP` is one such instruction.
Modifiers
^^^^^^^^^^^^^^^
TGSI supports modifiers on inputs (as well as saturate modifier on instructions).
For inputs which have a floating point type, both absolute value and negation
modifiers are supported (with absolute value being applied first).
TGSI_OPCODE_MOV is considered to have float input type for applying modifiers.
For inputs which have signed type only the negate modifier is supported. This
includes instructions which are otherwise ignorant if the type is signed or
unsigned, such as TGSI_OPCODE_UADD.
For inputs with unsigned type no modifiers are allowed.
Instruction Set
---------------