# [Mesa-dev] [PATCH 04/13] gallium/docs: Best view of conditional-expression operator via spaces

Alexander Troosh trush at yandex.ru
Wed Oct 8 04:40:21 PDT 2014

---
src/gallium/docs/source/tgsi.rst |  196 +++++++++++++++++++-------------------
1 files changed, 98 insertions(+), 98 deletions(-)

diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst
index c23408e..12c675e 100644
--- a/src/gallium/docs/source/tgsi.rst
+++ b/src/gallium/docs/source/tgsi.rst
@@ -76,7 +76,7 @@ used.

dst.x &= 1 \\
dst.y &= max(src.x, 0) \\
-  dst.z &= (src.x > 0) ? max(src.y, 0)^{clamp(src.w, -128, 128))} : 0 \\
+  dst.z &= (src.x > 0) ? \quad max(src.y, 0)^{clamp(src.w, -128, 128))} : 0 \\
dst.w &= 1

@@ -211,26 +211,26 @@ This instruction replicates its result.

.. math::

-  dst.x = (src0.x < src1.x) ? 1.0F : 0.0F
+  dst.x = (src0.x < src1.x) ? \quad 1.0F : 0.0F

-  dst.y = (src0.y < src1.y) ? 1.0F : 0.0F
+  dst.y = (src0.y < src1.y) ? \quad 1.0F : 0.0F

-  dst.z = (src0.z < src1.z) ? 1.0F : 0.0F
+  dst.z = (src0.z < src1.z) ? \quad 1.0F : 0.0F

-  dst.w = (src0.w < src1.w) ? 1.0F : 0.0F
+  dst.w = (src0.w < src1.w) ? \quad 1.0F : 0.0F

.. opcode:: SGE - Set On Greater Equal Than

.. math::

-  dst.x = (src0.x >= src1.x) ? 1.0F : 0.0F
+  dst.x = (src0.x >= src1.x) ? \quad 1.0F : 0.0F

-  dst.y = (src0.y >= src1.y) ? 1.0F : 0.0F
+  dst.y = (src0.y >= src1.y) ? \quad 1.0F : 0.0F

-  dst.z = (src0.z >= src1.z) ? 1.0F : 0.0F
+  dst.z = (src0.z >= src1.z) ? \quad 1.0F : 0.0F

-  dst.w = (src0.w >= src1.w) ? 1.0F : 0.0F
+  dst.w = (src0.w >= src1.w) ? \quad 1.0F : 0.0F

@@ -276,13 +276,13 @@ This instruction replicates its result.

.. math::

-  dst.x = (src2.x > 0.5) ? src0.x : src1.x
+  dst.x = (src2.x > 0.5) ? \quad src0.x : src1.x

-  dst.y = (src2.y > 0.5) ? src0.y : src1.y
+  dst.y = (src2.y > 0.5) ? \quad src0.y : src1.y

-  dst.z = (src2.z > 0.5) ? src0.z : src1.z
+  dst.z = (src2.z > 0.5) ? \quad src0.z : src1.z

-  dst.w = (src2.w > 0.5) ? src0.w : src1.w
+  dst.w = (src2.w > 0.5) ? \quad src0.w : src1.w

.. opcode:: DP2A - 2-component Dot Product And Add
@@ -412,7 +412,7 @@ XXX cleanup on aisle three

.. math::

-  dst = (src.x > 0) ? clamp(\frac1{src.x}, 5.42101e-020, 1.84467e+019) : clamp(\frac1{src.x}, -1.84467e+019, -5.42101e-020)
+  dst = (src.x > 0) ? \quad clamp(\frac1{src.x}, 5.42101e-020, 1.84467e+019) : clamp(\frac1{src.x}, -1.84467e+019, -5.42101e-020)

.. opcode:: DPH - Homogeneous Dot Product
@@ -508,13 +508,13 @@ while DDY is allowed to be the same for the entire 2x2 quad.

.. math::

-  dst.x = (src0.x == src1.x) ? 1.0F : 0.0F
+  dst.x = (src0.x == src1.x) ? \quad 1.0F : 0.0F

-  dst.y = (src0.y == src1.y) ? 1.0F : 0.0F
+  dst.y = (src0.y == src1.y) ? \quad 1.0F : 0.0F

-  dst.z = (src0.z == src1.z) ? 1.0F : 0.0F
+  dst.z = (src0.z == src1.z) ? \quad 1.0F : 0.0F

-  dst.w = (src0.w == src1.w) ? 1.0F : 0.0F
+  dst.w = (src0.w == src1.w) ? \quad 1.0F : 0.0F

.. opcode:: SFL - Set On False
@@ -534,13 +534,13 @@ This instruction replicates its result.

.. math::

-  dst.x = (src0.x > src1.x) ? 1.0F : 0.0F
+  dst.x = (src0.x > src1.x) ? \quad 1.0F : 0.0F

-  dst.y = (src0.y > src1.y) ? 1.0F : 0.0F
+  dst.y = (src0.y > src1.y) ? \quad 1.0F : 0.0F

-  dst.z = (src0.z > src1.z) ? 1.0F : 0.0F
+  dst.z = (src0.z > src1.z) ? \quad 1.0F : 0.0F

-  dst.w = (src0.w > src1.w) ? 1.0F : 0.0F
+  dst.w = (src0.w > src1.w) ? \quad 1.0F : 0.0F

.. opcode:: SIN - Sine
@@ -556,26 +556,26 @@ This instruction replicates its result.

.. math::

-  dst.x = (src0.x <= src1.x) ? 1.0F : 0.0F
+  dst.x = (src0.x <= src1.x) ? \quad 1.0F : 0.0F

-  dst.y = (src0.y <= src1.y) ? 1.0F : 0.0F
+  dst.y = (src0.y <= src1.y) ? \quad 1.0F : 0.0F

-  dst.z = (src0.z <= src1.z) ? 1.0F : 0.0F
+  dst.z = (src0.z <= src1.z) ? \quad 1.0F : 0.0F

-  dst.w = (src0.w <= src1.w) ? 1.0F : 0.0F
+  dst.w = (src0.w <= src1.w) ? \quad 1.0F : 0.0F

.. opcode:: SNE - Set On Not Equal

.. math::

-  dst.x = (src0.x != src1.x) ? 1.0F : 0.0F
+  dst.x = (src0.x != src1.x) ? \quad 1.0F : 0.0F

-  dst.y = (src0.y != src1.y) ? 1.0F : 0.0F
+  dst.y = (src0.y != src1.y) ? \quad 1.0F : 0.0F

-  dst.z = (src0.z != src1.z) ? 1.0F : 0.0F
+  dst.z = (src0.z != src1.z) ? \quad 1.0F : 0.0F

-  dst.w = (src0.w != src1.w) ? 1.0F : 0.0F
+  dst.w = (src0.w != src1.w) ? \quad 1.0F : 0.0F

.. opcode:: STR - Set On True
@@ -737,26 +737,26 @@ This instruction replicates its result.

.. math::

-  dst.x = (src.x > 0) ? 1 : (src.x < 0) ? -1 : 0
+  dst.x = (src.x > 0) ? \quad 1 : (src.x < 0) ? \quad -1 : 0

-  dst.y = (src.y > 0) ? 1 : (src.y < 0) ? -1 : 0
+  dst.y = (src.y > 0) ? \quad 1 : (src.y < 0) ? \quad -1 : 0

-  dst.z = (src.z > 0) ? 1 : (src.z < 0) ? -1 : 0
+  dst.z = (src.z > 0) ? \quad 1 : (src.z < 0) ? \quad -1 : 0

-  dst.w = (src.w > 0) ? 1 : (src.w < 0) ? -1 : 0
+  dst.w = (src.w > 0) ? \quad 1 : (src.w < 0) ? \quad -1 : 0

.. opcode:: CMP - Compare

.. math::

-  dst.x = (src0.x < 0) ? src1.x : src2.x
+  dst.x = (src0.x < 0) ? \quad src1.x : src2.x

-  dst.y = (src0.y < 0) ? src1.y : src2.y
+  dst.y = (src0.y < 0) ? \quad src1.y : src2.y

-  dst.z = (src0.z < 0) ? src1.z : src2.z
+  dst.z = (src0.z < 0) ? \quad src1.z : src2.z

-  dst.w = (src0.w < 0) ? src1.w : src2.w
+  dst.w = (src0.w < 0) ? \quad src1.w : src2.w

.. opcode:: KILL_IF - Conditional Discard
@@ -1462,13 +1462,13 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)

.. math::

-  dst.x = src0.x ? src1.x : src2.x
+  dst.x = src0.x ? \quad src1.x : src2.x

-  dst.y = src0.y ? src1.y : src2.y
+  dst.y = src0.y ? \quad src1.y : src2.y

-  dst.z = src0.z ? src1.z : src2.z
+  dst.z = src0.z ? \quad src1.z : src2.z

-  dst.w = src0.w ? src1.w : src2.w
+  dst.w = src0.w ? \quad src1.w : src2.w

@@ -1476,13 +1476,13 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)

.. math::

-  dst.x = (src0.x < 0) ? -1 : (src0.x > 0) ? 1 : 0
+  dst.x = (src0.x < 0) ? \quad -1 : (src0.x > 0) ? \quad 1 : 0

-  dst.y = (src0.y < 0) ? -1 : (src0.y > 0) ? 1 : 0
+  dst.y = (src0.y < 0) ? \quad -1 : (src0.y > 0) ? \quad 1 : 0

-  dst.z = (src0.z < 0) ? -1 : (src0.z > 0) ? 1 : 0
+  dst.z = (src0.z < 0) ? \quad -1 : (src0.z > 0) ? \quad 1 : 0

-  dst.w = (src0.w < 0) ? -1 : (src0.w > 0) ? 1 : 0
+  dst.w = (src0.w < 0) ? \quad -1 : (src0.w > 0) ? \quad 1 : 0

@@ -1492,39 +1492,39 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)

.. math::

-  dst.x = (src0.x < src1.x) ? \sim 0 : 0
+  dst.x = (src0.x < src1.x) ? \quad \sim 0 : 0

-  dst.y = (src0.y < src1.y) ? \sim 0 : 0
+  dst.y = (src0.y < src1.y) ? \quad \sim 0 : 0

-  dst.z = (src0.z < src1.z) ? \sim 0 : 0
+  dst.z = (src0.z < src1.z) ? \quad \sim 0 : 0

-  dst.w = (src0.w < src1.w) ? \sim 0 : 0
+  dst.w = (src0.w < src1.w) ? \quad \sim 0 : 0

.. opcode:: ISLT - Signed Integer Set On Less Than

.. math::

-  dst.x = (src0.x < src1.x) ? \sim 0 : 0
+  dst.x = (src0.x < src1.x) ? \quad \sim 0 : 0

-  dst.y = (src0.y < src1.y) ? \sim 0 : 0
+  dst.y = (src0.y < src1.y) ? \quad \sim 0 : 0

-  dst.z = (src0.z < src1.z) ? \sim 0 : 0
+  dst.z = (src0.z < src1.z) ? \quad \sim 0 : 0

-  dst.w = (src0.w < src1.w) ? \sim 0 : 0
+  dst.w = (src0.w < src1.w) ? \quad \sim 0 : 0

.. opcode:: USLT - Unsigned Integer Set On Less Than

.. math::

-  dst.x = (src0.x < src1.x) ? \sim 0 : 0
+  dst.x = (src0.x < src1.x) ? \quad \sim 0 : 0

-  dst.y = (src0.y < src1.y) ? \sim 0 : 0
+  dst.y = (src0.y < src1.y) ? \quad \sim 0 : 0

-  dst.z = (src0.z < src1.z) ? \sim 0 : 0
+  dst.z = (src0.z < src1.z) ? \quad \sim 0 : 0

-  dst.w = (src0.w < src1.w) ? \sim 0 : 0
+  dst.w = (src0.w < src1.w) ? \quad \sim 0 : 0

.. opcode:: FSGE - Float Set On Greater Equal Than (ordered)
@@ -1533,39 +1533,39 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)

.. math::

-  dst.x = (src0.x >= src1.x) ? \sim 0 : 0
+  dst.x = (src0.x >= src1.x) ? \quad \sim 0 : 0

-  dst.y = (src0.y >= src1.y) ? \sim 0 : 0
+  dst.y = (src0.y >= src1.y) ? \quad \sim 0 : 0

-  dst.z = (src0.z >= src1.z) ? \sim 0 : 0
+  dst.z = (src0.z >= src1.z) ? \quad \sim 0 : 0

-  dst.w = (src0.w >= src1.w) ? \sim 0 : 0
+  dst.w = (src0.w >= src1.w) ? \quad \sim 0 : 0

.. opcode:: ISGE - Signed Integer Set On Greater Equal Than

.. math::

-  dst.x = (src0.x >= src1.x) ? \sim 0 : 0
+  dst.x = (src0.x >= src1.x) ? \quad \sim 0 : 0

-  dst.y = (src0.y >= src1.y) ? \sim 0 : 0
+  dst.y = (src0.y >= src1.y) ? \quad \sim 0 : 0

-  dst.z = (src0.z >= src1.z) ? \sim 0 : 0
+  dst.z = (src0.z >= src1.z) ? \quad \sim 0 : 0

-  dst.w = (src0.w >= src1.w) ? \sim 0 : 0
+  dst.w = (src0.w >= src1.w) ? \quad \sim 0 : 0

.. opcode:: USGE - Unsigned Integer Set On Greater Equal Than

.. math::

-  dst.x = (src0.x >= src1.x) ? \sim 0 : 0
+  dst.x = (src0.x >= src1.x) ? \quad \sim 0 : 0

-  dst.y = (src0.y >= src1.y) ? \sim 0 : 0
+  dst.y = (src0.y >= src1.y) ? \quad \sim 0 : 0

-  dst.z = (src0.z >= src1.z) ? \sim 0 : 0
+  dst.z = (src0.z >= src1.z) ? \quad \sim 0 : 0

-  dst.w = (src0.w >= src1.w) ? \sim 0 : 0
+  dst.w = (src0.w >= src1.w) ? \quad \sim 0 : 0

.. opcode:: FSEQ - Float Set On Equal (ordered)
@@ -1574,26 +1574,26 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)

.. math::

-  dst.x = (src0.x == src1.x) ? \sim 0 : 0
+  dst.x = (src0.x == src1.x) ? \quad \sim 0 : 0

-  dst.y = (src0.y == src1.y) ? \sim 0 : 0
+  dst.y = (src0.y == src1.y) ? \quad \sim 0 : 0

-  dst.z = (src0.z == src1.z) ? \sim 0 : 0
+  dst.z = (src0.z == src1.z) ? \quad \sim 0 : 0

-  dst.w = (src0.w == src1.w) ? \sim 0 : 0
+  dst.w = (src0.w == src1.w) ? \quad \sim 0 : 0

.. opcode:: USEQ - Integer Set On Equal

.. math::

-  dst.x = (src0.x == src1.x) ? \sim 0 : 0
+  dst.x = (src0.x == src1.x) ? \quad \sim 0 : 0

-  dst.y = (src0.y == src1.y) ? \sim 0 : 0
+  dst.y = (src0.y == src1.y) ? \quad \sim 0 : 0

-  dst.z = (src0.z == src1.z) ? \sim 0 : 0
+  dst.z = (src0.z == src1.z) ? \quad \sim 0 : 0

-  dst.w = (src0.w == src1.w) ? \sim 0 : 0
+  dst.w = (src0.w == src1.w) ? \quad \sim 0 : 0

.. opcode:: FSNE - Float Set On Not Equal (unordered)
@@ -1602,26 +1602,26 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)

.. math::

-  dst.x = (src0.x != src1.x) ? \sim 0 : 0
+  dst.x = (src0.x != src1.x) ? \quad \sim 0 : 0

-  dst.y = (src0.y != src1.y) ? \sim 0 : 0
+  dst.y = (src0.y != src1.y) ? \quad \sim 0 : 0

-  dst.z = (src0.z != src1.z) ? \sim 0 : 0
+  dst.z = (src0.z != src1.z) ? \quad \sim 0 : 0

-  dst.w = (src0.w != src1.w) ? \sim 0 : 0
+  dst.w = (src0.w != src1.w) ? \quad \sim 0 : 0

.. opcode:: USNE - Integer Set On Not Equal

.. math::

-  dst.x = (src0.x != src1.x) ? \sim 0 : 0
+  dst.x = (src0.x != src1.x) ? \quad \sim 0 : 0

-  dst.y = (src0.y != src1.y) ? \sim 0 : 0
+  dst.y = (src0.y != src1.y) ? \quad \sim 0 : 0

-  dst.z = (src0.z != src1.z) ? \sim 0 : 0
+  dst.z = (src0.z != src1.z) ? \quad \sim 0 : 0

-  dst.w = (src0.w != src1.w) ? \sim 0 : 0
+  dst.w = (src0.w != src1.w) ? \quad \sim 0 : 0

.. opcode:: INEG - Integer Negate
@@ -1951,17 +1951,17 @@ Support for these opcodes is XXX undecided. :T

.. math::

-  dst.xy = src0.xy == src1.xy ? 1.0F : 0.0F
+  dst.xy = src0.xy == src1.xy ? \quad 1.0F : 0.0F

-  dst.zw = src0.zw == src1.zw ? 1.0F : 0.0F
+  dst.zw = src0.zw == src1.zw ? \quad 1.0F : 0.0F

.. opcode:: DSLT - Set on Less than

.. math::

-  dst.xy = src0.xy < src1.xy ? 1.0F : 0.0F
+  dst.xy = src0.xy < src1.xy ? \quad 1.0F : 0.0F

-  dst.zw = src0.zw < src1.zw ? 1.0F : 0.0F
+  dst.zw = src0.zw < src1.zw ? \quad 1.0F : 0.0F

.. opcode:: DFRAC - Fraction

@@ -2383,7 +2383,7 @@ For the moment they're only valid in compute programs.

dst_i = resource[offset]_i

-  resource[offset]_i = (dst_i == cmp_i ? src_i : dst_i)
+  resource[offset]_i = (dst_i == cmp_i ? \quad src_i : dst_i)

.. opcode:: ATOMAND - Atomic bitwise And
@@ -2443,7 +2443,7 @@ For the moment they're only valid in compute programs.

dst_i = resource[offset]_i

-  resource[offset]_i = (dst_i < src_i ? dst_i : src_i)
+  resource[offset]_i = (dst_i < src_i ? \quad dst_i : src_i)

.. opcode:: ATOMUMAX - Atomic unsigned maximum
@@ -2458,7 +2458,7 @@ For the moment they're only valid in compute programs.

dst_i = resource[offset]_i

-  resource[offset]_i = (dst_i > src_i ? dst_i : src_i)
+  resource[offset]_i = (dst_i > src_i ? \quad dst_i : src_i)

.. opcode:: ATOMIMIN - Atomic signed minimum
@@ -2473,7 +2473,7 @@ For the moment they're only valid in compute programs.

dst_i = resource[offset]_i

-  resource[offset]_i = (dst_i < src_i ? dst_i : src_i)
+  resource[offset]_i = (dst_i < src_i ? \quad dst_i : src_i)

.. opcode:: ATOMIMAX - Atomic signed maximum
@@ -2488,7 +2488,7 @@ For the moment they're only valid in compute programs.

dst_i = resource[offset]_i

-  resource[offset]_i = (dst_i > src_i ? dst_i : src_i)
+  resource[offset]_i = (dst_i > src_i ? \quad dst_i : src_i)

@@ -2505,17 +2505,17 @@ Functions
:math:\lceil x \rceil Ceiling of x.

clamp(x,y,z)      Clamp x between y and z.
-                    (x < y) ? y : (x > z) ? z : x
+                    (x < y) ? \quad y : (x > z) ? \quad z : x

:math:\lfloor x\rfloor Floor of x.

:math:\log_2{x} Logarithm of x, base 2.

max(x,y)          Maximum of x and y.
-                    (x > y) ? x : y
+                    (x > y) ? \quad x : y

min(x,y)          Minimum of x and y.
-                    (x < y) ? x : y
+                    (x < y) ? \quad x : y

partialx(x)       Derivative of x relative to fragment's X.

--
1.7.3.4