gallium: add double opcodes and TGSI execution (v4.2)

This patch adds support for a set of double opcodes
to TGSI. It is an update of work done originally
by Michal Krol on the gallium-double-opcodes branch.

The opcodes have a hint where they came from in the
header file.

v2: add unsigned/int <-> double
v2.1:  update docs.

v3: add DRSQ (Glenn), fix review comments (Glenn).

v4: drop DDIV
v4.1: cleanups, fix some docs bugs, (Ilia)
      rework store_dest and fetch_source fns. (Ilia)
4.2: fixup float comparisons (Ilia)

This is based on code by Michael Krol <michal@vmware.com>

Roland and Glenn also reviewed earlier versions.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Dave Airlie
2014-08-14 18:38:51 +10:00
committed by Dave Airlie
parent 14b9bf630c
commit 3cd1338534
4 changed files with 880 additions and 34 deletions

View File

@@ -1808,7 +1808,10 @@ Double ISA
The double-precision opcodes reinterpret four-component vectors into
two-component vectors with doubled precision in each component.
Support for these opcodes is XXX undecided. :T
.. opcode:: DABS - Absolute
dst.xy = |src0.xy|
dst.zw = |src0.zw|
.. opcode:: DADD - Add
@@ -1818,30 +1821,37 @@ Support for these opcodes is XXX undecided. :T
dst.zw = src0.zw + src1.zw
.. opcode:: DDIV - Divide
.. math::
dst.xy = src0.xy / src1.xy
dst.zw = src0.zw / src1.zw
.. opcode:: DSEQ - Set on Equal
.. math::
dst.xy = src0.xy == src1.xy ? 1.0F : 0.0F
dst.x = src0.xy == src1.xy ? \sim 0 : 0
dst.zw = src0.zw == src1.zw ? 1.0F : 0.0F
dst.z = src0.zw == src1.zw ? \sim 0 : 0
.. opcode:: DSNE - Set on Equal
.. math::
dst.x = src0.xy != src1.xy ? \sim 0 : 0
dst.z = src0.zw != src1.zw ? \sim 0 : 0
.. opcode:: DSLT - Set on Less than
.. math::
dst.xy = src0.xy < src1.xy ? 1.0F : 0.0F
dst.x = src0.xy < src1.xy ? \sim 0 : 0
dst.zw = src0.zw < src1.zw ? 1.0F : 0.0F
dst.z = src0.zw < src1.zw ? \sim 0 : 0
.. opcode:: DSGE - Set on Greater equal
.. math::
dst.x = src0.xy >= src1.xy ? \sim 0 : 0
dst.z = src0.zw >= src1.zw ? \sim 0 : 0
.. opcode:: DFRAC - Fraction
@@ -1870,13 +1880,14 @@ exponent of its source to ``dst0``, and the significand to ``dst1``, such that
.. opcode:: DLDEXP - Multiply Number by Integral Power of 2
This opcode is the inverse of :opcode:`DFRACEXP`.
This opcode is the inverse of :opcode:`DFRACEXP`. The second
source is an integer.
.. math::
dst.xy = src0.xy \times 2^{src1.xy}
dst.xy = src0.xy \times 2^{src1.x}
dst.zw = src0.zw \times 2^{src1.zw}
dst.zw = src0.zw \times 2^{src1.y}
.. opcode:: DMIN - Minimum
@@ -1928,6 +1939,61 @@ This opcode is the inverse of :opcode:`DFRACEXP`.
dst.zw = \sqrt{src.zw}
.. opcode:: DRSQ - Reciprocal Square Root
.. math::
dst.xy = \frac{1}{\sqrt{src.xy}}
dst.zw = \frac{1}{\sqrt{src.zw}}
.. opcode:: F2D - Float to Double
.. math::
dst.xy = double(src0.x)
dst.zw = double(src0.y)
.. opcode:: D2F - Double to Float
.. math::
dst.x = float(src0.xy)
dst.y = float(src0.zw)
.. opcode:: I2D - Int to Double
.. math::
dst.xy = double(src0.x)
dst.zw = double(src0.y)
.. opcode:: D2I - Double to Int
.. math::
dst.x = int(src0.xy)
dst.y = int(src0.zw)
.. opcode:: U2D - Unsigned Int to Double
.. math::
dst.xy = double(src0.x)
dst.zw = double(src0.y)
.. opcode:: D2U - Double to Unsigned Int
.. math::
dst.x = unsigned(src0.xy)
dst.y = unsigned(src0.zw)
.. _samplingopcodes: