[Mesa-dev] [PATCH 07/13] gallium/docs: alignment formulas

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


---
 src/gallium/docs/source/tgsi.rst | 1053 ++++++++++++++------------------------
 1 files changed, 387 insertions(+), 666 deletions(-)

diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst
index 2ace544..38b5602 100644
--- a/src/gallium/docs/source/tgsi.rst
+++ b/src/gallium/docs/source/tgsi.rst
@@ -48,26 +48,20 @@ used.
 
 .. math::
 
-  dst.x = \lfloor src.x\rfloor
-
-  dst.y = \lfloor src.y\rfloor
-
-  dst.z = \lfloor src.z\rfloor
-
-  dst.w = \lfloor src.w\rfloor
+  dst.x &= \lfloor src.x\rfloor \\
+  dst.y &= \lfloor src.y\rfloor \\
+  dst.z &= \lfloor src.z\rfloor \\
+  dst.w &= \lfloor src.w\rfloor
 
 
 .. opcode:: MOV - Move
 
 .. math::
 
-  dst.x = src.x
-
-  dst.y = src.y
-
-  dst.z = src.z
-
-  dst.w = src.w
+  dst.x &= src.x \\
+  dst.y &= src.y \\
+  dst.z &= src.z \\
+  dst.w &= src.w
 
 
 .. opcode:: LIT - Light Coefficients
@@ -131,26 +125,20 @@ This instruction replicates its result. The results are undefined for src < 0.
 
 .. math::
 
-  dst.x = src0.x \times src1.x
-
-  dst.y = src0.y \times src1.y
-
-  dst.z = src0.z \times src1.z
-
-  dst.w = src0.w \times src1.w
+  dst.x &= src0.x \times src1.x \\
+  dst.y &= src0.y \times src1.y \\
+  dst.z &= src0.z \times src1.z \\
+  dst.w &= src0.w \times src1.w
 
 
 .. opcode:: ADD - Add
 
 .. math::
 
-  dst.x = src0.x + src1.x
-
-  dst.y = src0.y + src1.y
-
-  dst.z = src0.z + src1.z
-
-  dst.w = src0.w + src1.w
+  dst.x &= src0.x + src1.x \\
+  dst.y &= src0.y + src1.y \\
+  dst.z &= src0.z + src1.z \\
+  dst.w &= src0.w + src1.w
 
 
 .. opcode:: DP3 - 3-component Dot Product
@@ -185,143 +173,110 @@ This instruction replicates its result.
 
 .. math::
 
-  dst.x = min(src0.x, src1.x)
-
-  dst.y = min(src0.y, src1.y)
-
-  dst.z = min(src0.z, src1.z)
-
-  dst.w = min(src0.w, src1.w)
+  dst.x &= min(src0.x, src1.x) \\
+  dst.y &= min(src0.y, src1.y) \\
+  dst.z &= min(src0.z, src1.z) \\
+  dst.w &= min(src0.w, src1.w)
 
 
 .. opcode:: MAX - Maximum
 
 .. math::
 
-  dst.x = max(src0.x, src1.x)
-
-  dst.y = max(src0.y, src1.y)
-
-  dst.z = max(src0.z, src1.z)
-
-  dst.w = max(src0.w, src1.w)
+  dst.x &= max(src0.x, src1.x) \\
+  dst.y &= max(src0.y, src1.y) \\
+  dst.z &= max(src0.z, src1.z) \\
+  dst.w &= max(src0.w, src1.w)
 
 
 .. opcode:: SLT - Set On Less Than
 
 .. math::
 
-  dst.x = (src0.x < src1.x) ? \quad 1.0F : 0.0F
-
-  dst.y = (src0.y < src1.y) ? \quad 1.0F : 0.0F
-
-  dst.z = (src0.z < src1.z) ? \quad 1.0F : 0.0F
-
-  dst.w = (src0.w < src1.w) ? \quad 1.0F : 0.0F
+  dst.x &= (src0.x < src1.x) ? \quad 1.0F : 0.0F \\
+  dst.y &= (src0.y < src1.y) ? \quad 1.0F : 0.0F \\
+  dst.z &= (src0.z < src1.z) ? \quad 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) ? \quad 1.0F : 0.0F
-
-  dst.y = (src0.y >= src1.y) ? \quad 1.0F : 0.0F
-
-  dst.z = (src0.z >= src1.z) ? \quad 1.0F : 0.0F
-
-  dst.w = (src0.w >= src1.w) ? \quad 1.0F : 0.0F
+  dst.x &= (src0.x >= src1.x) ? \quad 1.0F : 0.0F \\
+  dst.y &= (src0.y >= src1.y) ? \quad 1.0F : 0.0F \\
+  dst.z &= (src0.z >= src1.z) ? \quad 1.0F : 0.0F \\
+  dst.w &= (src0.w >= src1.w) ? \quad 1.0F : 0.0F
 
 
 .. opcode:: MAD - Multiply And Add
 
 .. math::
 
-  dst.x = src0.x \times src1.x + src2.x
-
-  dst.y = src0.y \times src1.y + src2.y
-
-  dst.z = src0.z \times src1.z + src2.z
-
-  dst.w = src0.w \times src1.w + src2.w
+  dst.x &= src0.x \times src1.x + src2.x \\
+  dst.y &= src0.y \times src1.y + src2.y \\
+  dst.z &= src0.z \times src1.z + src2.z \\
+  dst.w &= src0.w \times src1.w + src2.w
 
 
 .. opcode:: SUB - Subtract
 
 .. math::
 
-  dst.x = src0.x - src1.x
-
-  dst.y = src0.y - src1.y
-
-  dst.z = src0.z - src1.z
-
-  dst.w = src0.w - src1.w
+  dst.x &= src0.x - src1.x \\
+  dst.y &= src0.y - src1.y \\
+  dst.z &= src0.z - src1.z \\
+  dst.w &= src0.w - src1.w
 
 
 .. opcode:: LRP - Linear Interpolate
 
 .. math::
 
-  dst.x = src0.x \times src1.x + (1 - src0.x) \times src2.x
-
-  dst.y = src0.y \times src1.y + (1 - src0.y) \times src2.y
-
-  dst.z = src0.z \times src1.z + (1 - src0.z) \times src2.z
-
-  dst.w = src0.w \times src1.w + (1 - src0.w) \times src2.w
+  dst.x &= src0.x \times src1.x + (1 - src0.x) \times src2.x \\
+  dst.y &= src0.y \times src1.y + (1 - src0.y) \times src2.y \\
+  dst.z &= src0.z \times src1.z + (1 - src0.z) \times src2.z \\
+  dst.w &= src0.w \times src1.w + (1 - src0.w) \times src2.w
 
 
 .. opcode:: CND - Condition
 
 .. math::
 
-  dst.x = (src2.x > 0.5) ? \quad src0.x : src1.x
-
-  dst.y = (src2.y > 0.5) ? \quad src0.y : src1.y
-
-  dst.z = (src2.z > 0.5) ? \quad src0.z : src1.z
-
-  dst.w = (src2.w > 0.5) ? \quad src0.w : src1.w
+  dst.x &= (src2.x > 0.5) ? \quad src0.x : src1.x \\
+  dst.y &= (src2.y > 0.5) ? \quad src0.y : src1.y \\
+  dst.z &= (src2.z > 0.5) ? \quad src0.z : src1.z \\
+  dst.w &= (src2.w > 0.5) ? \quad src0.w : src1.w
 
 
 .. opcode:: DP2A - 2-component Dot Product And Add
 
 .. math::
 
-  dst.x = src0.x \times src1.x + src0.y \times src1.y + src2.x
-
-  dst.y = src0.x \times src1.x + src0.y \times src1.y + src2.x
-
-  dst.z = src0.x \times src1.x + src0.y \times src1.y + src2.x
-
-  dst.w = src0.x \times src1.x + src0.y \times src1.y + src2.x
+  dst.x &= src0.x \times src1.x + src0.y \times src1.y + src2.x \\
+  dst.y &= src0.x \times src1.x + src0.y \times src1.y + src2.x \\
+  dst.z &= src0.x \times src1.x + src0.y \times src1.y + src2.x \\
+  dst.w &= src0.x \times src1.x + src0.y \times src1.y + src2.x
 
 
 .. opcode:: FRC - Fraction
 
 .. math::
 
-  dst.x = src.x - \lfloor src.x\rfloor
-
-  dst.y = src.y - \lfloor src.y\rfloor
-
-  dst.z = src.z - \lfloor src.z\rfloor
-
-  dst.w = src.w - \lfloor src.w\rfloor
+  dst.x &= src.x - \lfloor src.x\rfloor \\
+  dst.y &= src.y - \lfloor src.y\rfloor \\
+  dst.z &= src.z - \lfloor src.z\rfloor \\
+  dst.w &= src.w - \lfloor src.w\rfloor
 
 
 .. opcode:: CLAMP - Clamp
 
 .. math::
 
-  dst.x = clamp(src0.x, src1.x, src2.x)
-
-  dst.y = clamp(src0.y, src1.y, src2.y)
-
-  dst.z = clamp(src0.z, src1.z, src2.z)
-
-  dst.w = clamp(src0.w, src1.w, src2.w)
+  dst.x &= clamp(src0.x, src1.x, src2.x) \\
+  dst.y &= clamp(src0.y, src1.y, src2.y) \\
+  dst.z &= clamp(src0.z, src1.z, src2.z) \\
+  dst.w &= clamp(src0.w, src1.w, src2.w)
 
 
 .. opcode:: FLR - Floor
@@ -330,26 +285,20 @@ This is identical to :opcode:`ARL`.
 
 .. math::
 
-  dst.x = \lfloor src.x\rfloor
-
-  dst.y = \lfloor src.y\rfloor
-
-  dst.z = \lfloor src.z\rfloor
-
-  dst.w = \lfloor src.w\rfloor
+  dst.x &= \lfloor src.x\rfloor \\
+  dst.y &= \lfloor src.y\rfloor \\
+  dst.z &= \lfloor src.z\rfloor \\
+  dst.w &= \lfloor src.w\rfloor
 
 
 .. opcode:: ROUND - Round
 
 .. math::
 
-  dst.x = round(src.x)
-
-  dst.y = round(src.y)
-
-  dst.z = round(src.z)
-
-  dst.w = round(src.w)
+  dst.x &= round(src.x) \\
+  dst.y &= round(src.y) \\
+  dst.z &= round(src.z) \\
+  dst.w &= round(src.w)
 
 
 .. opcode:: EX2 - Exponential Base 2
@@ -382,26 +331,20 @@ This instruction replicates its result.
 
 .. math::
 
-  dst.x = src0.y \times src1.z - src1.y \times src0.z
-
-  dst.y = src0.z \times src1.x - src1.z \times src0.x
-
-  dst.z = src0.x \times src1.y - src1.x \times src0.y
-
-  dst.w = 1
+  dst.x &= src0.y \times src1.z - src1.y \times src0.z \\
+  dst.y &= src0.z \times src1.x - src1.z \times src0.x \\
+  dst.z &= src0.x \times src1.y - src1.x \times src0.y \\
+  dst.w &= 1
 
 
 .. opcode:: ABS - Absolute
 
 .. math::
 
-  dst.x = |src.x|
-
-  dst.y = |src.y|
-
-  dst.z = |src.z|
-
-  dst.w = |src.w|
+  dst.x &= |src.x| \\
+  dst.y &= |src.y| \\
+  dst.z &= |src.z| \\
+  dst.w &= |src.w|
 
 
 .. opcode:: RCC - Reciprocal Clamped
@@ -440,13 +383,10 @@ while DDX is allowed to be the same for the entire 2x2 quad.
 
 .. math::
 
-  dst.x = partialx(src.x)
-
-  dst.y = partialx(src.y)
-
-  dst.z = partialx(src.z)
-
-  dst.w = partialx(src.w)
+  dst.x &= partialx(src.x) \\
+  dst.y &= partialx(src.y) \\
+  dst.z &= partialx(src.z) \\
+  dst.w &= partialx(src.w)
 
 
 .. opcode:: DDY, DDY_FINE - Derivative Relative To Y
@@ -457,13 +397,10 @@ while DDY is allowed to be the same for the entire 2x2 quad.
 
 .. math::
 
-  dst.x = partialy(src.x)
-
-  dst.y = partialy(src.y)
-
-  dst.z = partialy(src.z)
-
-  dst.w = partialy(src.w)
+  dst.x &= partialy(src.x) \\
+  dst.y &= partialy(src.y) \\
+  dst.z &= partialy(src.z) \\
+  dst.w &= partialy(src.w)
 
 
 .. opcode:: PK2H - Pack Two 16-bit Floats
@@ -490,13 +427,10 @@ while DDY is allowed to be the same for the entire 2x2 quad.
 
 .. math::
 
-  dst.x = 2 \times \frac{src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z} {((src0.x)^2 + (src0.y)^2 + (src0.z)^2) \times src0.x} - src1.x
-
-  dst.y = 2 \times \frac{src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z} {((src0.x)^2 + (src0.y)^2 + (src0.z)^2) \times src0.y} - src1.y
-
-  dst.z = 2 \times \frac{src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z} {((src0.x)^2 + (src0.y)^2 + (src0.z)^2) \times src0.z} - src1.z
-
-  dst.w = 1
+  dst.x &= 2 \times \frac{src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z} {((src0.x)^2 + (src0.y)^2 + (src0.z)^2) \times src0.x} - src1.x \\
+  dst.y &= 2 \times \frac{src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z} {((src0.x)^2 + (src0.y)^2 + (src0.z)^2) \times src0.y} - src1.y \\
+  dst.z &= 2 \times \frac{src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z} {((src0.x)^2 + (src0.y)^2 + (src0.z)^2) \times src0.z} - src1.z \\
+  dst.w &= 1
 
 .. note::
 
@@ -507,13 +441,10 @@ while DDY is allowed to be the same for the entire 2x2 quad.
 
 .. math::
 
-  dst.x = (src0.x == src1.x) ? \quad 1.0F : 0.0F
-
-  dst.y = (src0.y == src1.y) ? \quad 1.0F : 0.0F
-
-  dst.z = (src0.z == src1.z) ? \quad 1.0F : 0.0F
-
-  dst.w = (src0.w == src1.w) ? \quad 1.0F : 0.0F
+  dst.x &= (src0.x == src1.x) ? \quad 1.0F : 0.0F \\
+  dst.y &= (src0.y == src1.y) ? \quad 1.0F : 0.0F \\
+  dst.z &= (src0.z == src1.z) ? \quad 1.0F : 0.0F \\
+  dst.w &= (src0.w == src1.w) ? \quad 1.0F : 0.0F
 
 
 .. opcode:: SFL - Set On False
@@ -533,13 +464,10 @@ This instruction replicates its result.
 
 .. math::
 
-  dst.x = (src0.x > src1.x) ? \quad 1.0F : 0.0F
-
-  dst.y = (src0.y > src1.y) ? \quad 1.0F : 0.0F
-
-  dst.z = (src0.z > src1.z) ? \quad 1.0F : 0.0F
-
-  dst.w = (src0.w > src1.w) ? \quad 1.0F : 0.0F
+  dst.x &= (src0.x > src1.x) ? \quad 1.0F : 0.0F \\
+  dst.y &= (src0.y > src1.y) ? \quad 1.0F : 0.0F \\
+  dst.z &= (src0.z > src1.z) ? \quad 1.0F : 0.0F \\
+  dst.w &= (src0.w > src1.w) ? \quad 1.0F : 0.0F
 
 
 .. opcode:: SIN - Sine
@@ -555,26 +483,20 @@ This instruction replicates its result.
 
 .. math::
 
-  dst.x = (src0.x <= src1.x) ? \quad 1.0F : 0.0F
-
-  dst.y = (src0.y <= src1.y) ? \quad 1.0F : 0.0F
-
-  dst.z = (src0.z <= src1.z) ? \quad 1.0F : 0.0F
-
-  dst.w = (src0.w <= src1.w) ? \quad 1.0F : 0.0F
+  dst.x &= (src0.x <= src1.x) ? \quad 1.0F : 0.0F \\
+  dst.y &= (src0.y <= src1.y) ? \quad 1.0F : 0.0F \\
+  dst.z &= (src0.z <= src1.z) ? \quad 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) ? \quad 1.0F : 0.0F
-
-  dst.y = (src0.y != src1.y) ? \quad 1.0F : 0.0F
-
-  dst.z = (src0.z != src1.z) ? \quad 1.0F : 0.0F
-
-  dst.w = (src0.w != src1.w) ? \quad 1.0F : 0.0F
+  dst.x &= (src0.x != src1.x) ? \quad 1.0F : 0.0F \\
+  dst.y &= (src0.y != src1.y) ? \quad 1.0F : 0.0F \\
+  dst.z &= (src0.z != src1.z) ? \quad 1.0F : 0.0F \\
+  dst.w &= (src0.w != src1.w) ? \quad 1.0F : 0.0F
 
 
 .. opcode:: STR - Set On True
@@ -603,13 +525,11 @@ This instruction replicates its result.
 
 .. math::
 
-  coord = src0
-
-  shadow_ref = src0.z \quad or \quad src0.w (optional)
+  coord       &= src0                                    \\
+  shadow\_ref &= src0.z \quad or \quad src0.w (optional) \\
+  unit        &= src1
 
-  unit = src1
-
-  dst = texture\_sample(unit, coord, shadow_ref)
+  dst = texture\_sample(unit, coord, shadow\_ref)
 
 
 .. opcode:: TEX2 - Texture Lookup (for shadow cube map arrays only)
@@ -619,28 +539,21 @@ This instruction replicates its result.
 
 .. math::
 
-  coord = src0
-
-  shadow_ref = src1.x
-
-  unit = src2
-
-  dst = texture\_sample(unit, coord, shadow_ref)
-
+  coord       &= src0   \\
+  shadow\_ref &= src1.x \\
+  unit        &= src2
 
+  dst = texture\_sample(unit, coord, shadow\_ref)
 
 
 .. opcode:: TXD - Texture Lookup with Derivatives
 
 .. math::
 
-  coord = src0
-
-  ddx = src1
-
-  ddy = src2
-
-  unit = src3
+  coord &= src0 \\
+  ddx   &= src1 \\
+  ddy   &= src2 \\
+  unit  &= src3
 
   dst = texture\_sample\_deriv(unit, coord, ddx, ddy)
 
@@ -649,15 +562,11 @@ This instruction replicates its result.
 
 .. math::
 
-  coord.x = \frac{src0.x}{src0.w}
-
-  coord.y = \frac{src0.y}{src0.w}
-
-  coord.z = \frac{src0.z}{src0.w}
-
-  coord.w = src0.w
-
-  unit = src1
+  coord.x &= \frac{src0.x}{src0.w} \\
+  coord.y &= \frac{src0.y}{src0.w} \\
+  coord.z &= \frac{src0.z}{src0.w} \\
+  coord.w &= src0.w \\
+  unit    &= src1
 
   dst = texture\_sample(unit, coord)
 
@@ -698,13 +607,10 @@ This instruction replicates its result.
 
 .. math::
 
-  dst.x = src0.x + src1.x \times src2.x + src1.y \times src2.y
-
-  dst.y = src0.y + src1.x \times src2.z + src1.y \times src2.w
-
-  dst.z = src0.x + src1.x \times src2.x + src1.y \times src2.y
-
-  dst.w = src0.y + src1.x \times src2.z + src1.y \times src2.w
+  dst.x &= src0.x + src1.x \times src2.x + src1.y \times src2.y \\
+  dst.y &= src0.y + src1.x \times src2.z + src1.y \times src2.w \\
+  dst.z &= src0.x + src1.x \times src2.x + src1.y \times src2.y \\
+  dst.w &= src0.y + src1.x \times src2.z + src1.y \times src2.w
 
 .. note::
 
@@ -723,39 +629,30 @@ This instruction replicates its result.
 
 .. math::
 
-  dst.x = round(src.x)
-
-  dst.y = round(src.y)
-
-  dst.z = round(src.z)
-
-  dst.w = round(src.w)
+  dst.x &= round(src.x) \\
+  dst.y &= round(src.y) \\
+  dst.z &= round(src.z) \\
+  dst.w &= round(src.w)
 
 
 .. opcode:: SSG - Set Sign
 
 .. math::
 
-  dst.x = (src.x > 0) ? \quad 1 : ((src.x < 0) ? \quad -1 : 0)
-
-  dst.y = (src.y > 0) ? \quad 1 : ((src.y < 0) ? \quad -1 : 0)
-
-  dst.z = (src.z > 0) ? \quad 1 : ((src.z < 0) ? \quad -1 : 0)
-
-  dst.w = (src.w > 0) ? \quad 1 : ((src.w < 0) ? \quad -1 : 0)
+  dst.x &= (src.x > 0) ? \quad 1 : ((src.x < 0) ? \quad -1 : 0) \\
+  dst.y &= (src.y > 0) ? \quad 1 : ((src.y < 0) ? \quad -1 : 0) \\
+  dst.z &= (src.z > 0) ? \quad 1 : ((src.z < 0) ? \quad -1 : 0) \\
+  dst.w &= (src.w > 0) ? \quad 1 : ((src.w < 0) ? \quad -1 : 0)
 
 
 .. opcode:: CMP - Compare
 
 .. math::
 
-  dst.x = (src0.x < 0) ? \quad src1.x : src2.x
-
-  dst.y = (src0.y < 0) ? \quad src1.y : src2.y
-
-  dst.z = (src0.z < 0) ? \quad src1.z : src2.z
-
-  dst.w = (src0.w < 0) ? \quad src1.w : src2.w
+  dst.x &= (src0.x < 0) ? \quad src1.x : src2.x \\
+  dst.y &= (src0.y < 0) ? \quad src1.y : src2.y \\
+  dst.z &= (src0.z < 0) ? \quad src1.z : src2.z \\
+  dst.w &= (src0.w < 0) ? \quad src1.w : src2.w
 
 
 .. opcode:: KILL_IF - Conditional Discard
@@ -778,13 +675,10 @@ This instruction replicates its result.
 
 .. math::
 
-  dst.x = \cos{(src.x)}
-
-  dst.y = \sin{(src.x)}
-
-  dst.z = 0
-
-  dst.w = 1
+  dst.x &= \cos{(src.x)} \\
+  dst.y &= \sin{(src.x)} \\
+  dst.z &= 0             \\
+  dst.w &= 1
 
 
 .. opcode:: TXB - Texture Lookup With Bias
@@ -798,17 +692,12 @@ This instruction replicates its result.
 
 .. math::
 
-  coord.x = src0.x
-
-  coord.y = src0.y
-
-  coord.z = src0.z
-
-  coord.w = none
-
-  bias = src0.w
-
-  unit = src1
+  coord.x &= src0.x \\
+  coord.y &= src0.y \\
+  coord.z &= src0.z \\
+  coord.w &= none   \\
+  bias    &= src0.w \\
+  unit    &= src1
 
   dst = texture\_sample(unit, coord, bias)
 
@@ -824,11 +713,9 @@ This instruction replicates its result.
 
 .. math::
 
-  coord = src0
-
-  bias = src1.x
-
-  unit = src2
+  coord &= src0   \\
+  bias  &= src1.x \\
+  unit  &= src2
 
   dst = texture\_sample(unit, coord, bias)
 
@@ -837,26 +724,20 @@ This instruction replicates its result.
 
 .. math::
 
-  dst.x = \frac{src.x} {(src.x)^2 + (src.y)^2 + (src.z)^2}
-
-  dst.y = \frac{src.y} {(src.x)^2 + (src.y)^2 + (src.z)^2}
-
-  dst.z = \frac{src.z} {(src.x)^2 + (src.y)^2 + (src.z)^2}
-
-  dst.w = 1
+  dst.x &= \frac{src.x} {(src.x)^2 + (src.y)^2 + (src.z)^2} \\
+  dst.y &= \frac{src.y} {(src.x)^2 + (src.y)^2 + (src.z)^2} \\
+  dst.z &= \frac{src.z} {(src.x)^2 + (src.y)^2 + (src.z)^2} \\
+  dst.w &= 1
 
 
 .. opcode:: DIV - Divide
 
 .. math::
 
-  dst.x = \frac{src0.x}{src1.x}
-
-  dst.y = \frac{src0.y}{src1.y}
-
-  dst.z = \frac{src0.z}{src1.z}
-
-  dst.w = \frac{src0.w}{src1.w}
+  dst.x &= \frac{src0.x}{src1.x} \\
+  dst.y &= \frac{src0.y}{src1.y} \\
+  dst.z &= \frac{src0.z}{src1.z} \\
+  dst.w &= \frac{src0.w}{src1.w}
 
 
 .. opcode:: DP2 - 2-component Dot Product
@@ -879,17 +760,12 @@ This instruction replicates its result.
 
 .. math::
 
-  coord.x = src0.x
-
-  coord.y = src0.y
-
-  coord.z = src0.z
-
-  coord.w = none
-
-  lod = src0.w
-
-  unit = src1
+  coord.x &= src0.x \\
+  coord.y &= src0.y \\
+  coord.z &= src0.z \\
+  coord.w &= none   \\
+  lod     &= src0.w \\
+  unit    &= src1
 
   dst = texture\_sample(unit, coord, lod)
 
@@ -905,11 +781,9 @@ This instruction replicates its result.
 
 .. math::
 
-  coord = src0
-
-  lod = src1.x
-
-  unit = src2
+  coord &= src0   \\
+  lod   &= src1.x \\
+  unit  &= src2
 
   dst = texture\_sample(unit, coord, lod)
 
@@ -979,39 +853,30 @@ XXX doesn't look like most of the opcodes really belong here.
 
 .. math::
 
-  dst.x = \lceil src.x\rceil
-
-  dst.y = \lceil src.y\rceil
-
-  dst.z = \lceil src.z\rceil
-
-  dst.w = \lceil src.w\rceil
+  dst.x &= \lceil src.x\rceil \\
+  dst.y &= \lceil src.y\rceil \\
+  dst.z &= \lceil src.z\rceil \\
+  dst.w &= \lceil src.w\rceil
 
 
 .. opcode:: TRUNC - Truncate
 
 .. math::
 
-  dst.x = trunc(src.x)
-
-  dst.y = trunc(src.y)
-
-  dst.z = trunc(src.z)
-
-  dst.w = trunc(src.w)
+  dst.x &= trunc(src.x) \\
+  dst.y &= trunc(src.y) \\
+  dst.z &= trunc(src.z) \\
+  dst.w &= trunc(src.w)
 
 
 .. opcode:: MOD - Modulus
 
 .. math::
 
-  dst.x = src0.x \bmod src1.x
-
-  dst.y = src0.y \bmod src1.y
-
-  dst.z = src0.z \bmod src1.z
-
-  dst.w = src0.w \bmod src1.w
+  dst.x &= src0.x \bmod src1.x \\
+  dst.y &= src0.y \bmod src1.y \\
+  dst.z &= src0.z \bmod src1.z \\
+  dst.w &= src0.w \bmod src1.w
 
 
 .. opcode:: UARL - Integer Address Register Load
@@ -1024,13 +889,10 @@ XXX doesn't look like most of the opcodes really belong here.
 
 .. math::
 
-  dst.x = |src0.x - src1.x| + src2.x
-
-  dst.y = |src0.y - src1.y| + src2.y
-
-  dst.z = |src0.z - src1.z| + src2.z
-
-  dst.w = |src0.w - src1.w| + src2.w
+  dst.x &= |src0.x - src1.x| + src2.x \\
+  dst.y &= |src0.y - src1.y| + src2.y \\
+  dst.z &= |src0.z - src1.z| + src2.z \\
+  dst.w &= |src0.w - src1.w| + src2.w
 
 
 .. opcode:: TXF - Texel Fetch
@@ -1060,13 +922,10 @@ XXX doesn't look like most of the opcodes really belong here.
 
   lod = src0.x
 
-  dst.x = texture\_width(unit, lod)
-
-  dst.y = texture\_height(unit, lod)
-
-  dst.z = texture\_depth(unit, lod)
-
-  dst.w = texture\_levels(unit)
+  dst.x &= texture\_width(unit, lod)  \\
+  dst.y &= texture\_height(unit, lod) \\
+  dst.z &= texture\_depth(unit, lod)  \\
+  dst.w &= texture\_levels(unit)
 
 .. opcode:: TG4 - Texture Gather
 
@@ -1088,9 +947,8 @@ XXX doesn't look like most of the opcodes really belong here.
 
 .. math::
 
-   coord = src0
-
-   component = src1
+   coord     &= src0 \\
+   component &= src1
 
    dst = texture\_gather4 (unit, coord, component)
 
@@ -1098,9 +956,8 @@ XXX doesn't look like most of the opcodes really belong here.
 
 .. math::
 
-   coord = src0
-
-   compare = src1
+   coord   &= src0 \\
+   compare &= src1
 
    dst = texture\_gather (uint, coord, compare)
 
@@ -1129,13 +986,10 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = (float) src.x
-
-  dst.y = (float) src.y
-
-  dst.z = (float) src.z
-
-  dst.w = (float) src.w
+  dst.x &= (float) src.x \\
+  dst.y &= (float) src.y \\
+  dst.z &= (float) src.z \\
+  dst.w &= (float) src.w
 
 
 .. opcode:: U2F - Unsigned Integer To Float
@@ -1144,13 +998,10 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = (float) src.x
-
-  dst.y = (float) src.y
-
-  dst.z = (float) src.z
-
-  dst.w = (float) src.w
+  dst.x &= (float) src.x \\
+  dst.y &= (float) src.y \\
+  dst.z &= (float) src.z \\
+  dst.w &= (float) src.w
 
 
 .. opcode:: F2I - Float to Signed Integer
@@ -1160,13 +1011,10 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = (int) src.x
-
-  dst.y = (int) src.y
-
-  dst.z = (int) src.z
-
-  dst.w = (int) src.w
+  dst.x &= (int) src.x \\
+  dst.y &= (int) src.y \\
+  dst.z &= (int) src.z \\
+  dst.w &= (int) src.w
 
 
 .. opcode:: F2U - Float to Unsigned Integer
@@ -1176,13 +1024,10 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = (unsigned) src.x
-
-  dst.y = (unsigned) src.y
-
-  dst.z = (unsigned) src.z
-
-  dst.w = (unsigned) src.w
+  dst.x &= (unsigned) src.x \\
+  dst.y &= (unsigned) src.y \\
+  dst.z &= (unsigned) src.z \\
+  dst.w &= (unsigned) src.w
 
 
 .. opcode:: UADD - Integer Add
@@ -1192,13 +1037,10 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = src0.x + src1.x
-
-  dst.y = src0.y + src1.y
-
-  dst.z = src0.z + src1.z
-
-  dst.w = src0.w + src1.w
+  dst.x &= src0.x + src1.x \\
+  dst.y &= src0.y + src1.y \\
+  dst.z &= src0.z + src1.z \\
+  dst.w &= src0.w + src1.w
 
 
 .. opcode:: UMAD - Integer Multiply And Add
@@ -1208,13 +1050,10 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = src0.x \times src1.x + src2.x
-
-  dst.y = src0.y \times src1.y + src2.y
-
-  dst.z = src0.z \times src1.z + src2.z
-
-  dst.w = src0.w \times src1.w + src2.w
+  dst.x &= src0.x \times src1.x + src2.x \\
+  dst.y &= src0.y \times src1.y + src2.y \\
+  dst.z &= src0.z \times src1.z + src2.z \\
+  dst.w &= src0.w \times src1.w + src2.w
 
 
 .. opcode:: UMUL - Integer Multiply
@@ -1224,13 +1063,10 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = src0.x \times src1.x
-
-  dst.y = src0.y \times src1.y
-
-  dst.z = src0.z \times src1.z
-
-  dst.w = src0.w \times src1.w
+  dst.x &= src0.x \times src1.x \\
+  dst.y &= src0.y \times src1.y \\
+  dst.z &= src0.z \times src1.z \\
+  dst.w &= src0.w \times src1.w
 
 
 .. opcode:: IMUL_HI - Signed Integer Multiply High Bits
@@ -1239,13 +1075,10 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = (src0.x \times src1.x) >> 32
-
-  dst.y = (src0.y \times src1.y) >> 32
-
-  dst.z = (src0.z \times src1.z) >> 32
-
-  dst.w = (src0.w \times src1.w) >> 32
+  dst.x &= (src0.x \times src1.x) >> 32 \\
+  dst.y &= (src0.y \times src1.y) >> 32 \\
+  dst.z &= (src0.z \times src1.z) >> 32 \\
+  dst.w &= (src0.w \times src1.w) >> 32
 
 
 .. opcode:: UMUL_HI - Unsigned Integer Multiply High Bits
@@ -1254,13 +1087,10 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = (src0.x \times src1.x) >> 32
-
-  dst.y = (src0.y \times src1.y) >> 32
-
-  dst.z = (src0.z \times src1.z) >> 32
-
-  dst.w = (src0.w \times src1.w) >> 32
+  dst.x &= (src0.x \times src1.x) >> 32 \\
+  dst.y &= (src0.y \times src1.y) >> 32 \\
+  dst.z &= (src0.z \times src1.z) >> 32 \\
+  dst.w &= (src0.w \times src1.w) >> 32
 
 
 .. opcode:: IDIV - Signed Integer Division
@@ -1269,13 +1099,10 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = \frac{src0.x}{src1.x}
-
-  dst.y = \frac{src0.y}{src1.y}
-
-  dst.z = \frac{src0.z}{src1.z}
-
-  dst.w = \frac{src0.w}{src1.w}
+  dst.x &= \frac{src0.x}{src1.x} \\
+  dst.y &= \frac{src0.y}{src1.y} \\
+  dst.z &= \frac{src0.z}{src1.z} \\
+  dst.w &= \frac{src0.w}{src1.w}
 
 
 .. opcode:: UDIV - Unsigned Integer Division
@@ -1284,13 +1111,10 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = \frac{src0.x}{src1.x}
-
-  dst.y = \frac{src0.y}{src1.y}
-
-  dst.z = \frac{src0.z}{src1.z}
-
-  dst.w = \frac{src0.w}{src1.w}
+  dst.x &= \frac{src0.x}{src1.x} \\
+  dst.y &= \frac{src0.y}{src1.y} \\
+  dst.z &= \frac{src0.z}{src1.z} \\
+  dst.w &= \frac{src0.w}{src1.w}
 
 
 .. opcode:: UMOD - Unsigned Integer Remainder
@@ -1299,117 +1123,90 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = src0.x \quad \% \quad src1.x
-
-  dst.y = src0.y \quad \% \quad src1.y
-
-  dst.z = src0.z \quad \% \quad src1.z
-
-  dst.w = src0.w \quad \% \quad src1.w
+  dst.x &= src0.x \quad \% \quad src1.x \\
+  dst.y &= src0.y \quad \% \quad src1.y \\
+  dst.z &= src0.z \quad \% \quad src1.z \\
+  dst.w &= src0.w \quad \% \quad src1.w
 
 
 .. opcode:: NOT - Bitwise Not
 
 .. math::
 
-  dst.x = \quad \sim (src.x)
-
-  dst.y = \quad \sim (src.y)
-
-  dst.z = \quad \sim (src.z)
-
-  dst.w = \quad \sim (src.w)
+  dst.x &= \quad \sim (src.x) \\
+  dst.y &= \quad \sim (src.y) \\
+  dst.z &= \quad \sim (src.z) \\
+  dst.w &= \quad \sim (src.w)
 
 
 .. opcode:: AND - Bitwise And
 
 .. math::
 
-  dst.x = src0.x \quad \& \quad src1.x
-
-  dst.y = src0.y \quad \& \quad src1.y
-
-  dst.z = src0.z \quad \& \quad src1.z
-
-  dst.w = src0.w \quad \& \quad src1.w
+  dst.x &= src0.x \quad \& \quad src1.x \\
+  dst.y &= src0.y \quad \& \quad src1.y \\
+  dst.z &= src0.z \quad \& \quad src1.z \\
+  dst.w &= src0.w \quad \& \quad src1.w
 
 
 .. opcode:: OR - Bitwise Or
 
 .. math::
 
-  dst.x = src0.x \quad | \quad src1.x
-
-  dst.y = src0.y \quad | \quad src1.y
-
-  dst.z = src0.z \quad | \quad src1.z
-
-  dst.w = src0.w \quad | \quad src1.w
+  dst.x &= src0.x \quad | \quad src1.x \\
+  dst.y &= src0.y \quad | \quad src1.y \\
+  dst.z &= src0.z \quad | \quad src1.z \\
+  dst.w &= src0.w \quad | \quad src1.w
 
 
 .. opcode:: XOR - Bitwise Xor
 
 .. math::
 
-  dst.x = src0.x \oplus src1.x
-
-  dst.y = src0.y \oplus src1.y
-
-  dst.z = src0.z \oplus src1.z
-
-  dst.w = src0.w \oplus src1.w
+  dst.x &= src0.x \oplus src1.x \\
+  dst.y &= src0.y \oplus src1.y \\
+  dst.z &= src0.z \oplus src1.z \\
+  dst.w &= src0.w \oplus src1.w
 
 
 .. opcode:: IMAX - Maximum of Signed Integers
 
 .. math::
 
-  dst.x = max(src0.x, src1.x)
-
-  dst.y = max(src0.y, src1.y)
-
-  dst.z = max(src0.z, src1.z)
-
-  dst.w = max(src0.w, src1.w)
+  dst.x &= max(src0.x, src1.x) \\
+  dst.y &= max(src0.y, src1.y) \\
+  dst.z &= max(src0.z, src1.z) \\
+  dst.w &= max(src0.w, src1.w)
 
 
 .. opcode:: UMAX - Maximum of Unsigned Integers
 
 .. math::
 
-  dst.x = max(src0.x, src1.x)
-
-  dst.y = max(src0.y, src1.y)
-
-  dst.z = max(src0.z, src1.z)
-
-  dst.w = max(src0.w, src1.w)
+  dst.x &= max(src0.x, src1.x) \\
+  dst.y &= max(src0.y, src1.y) \\
+  dst.z &= max(src0.z, src1.z) \\
+  dst.w &= max(src0.w, src1.w)
 
 
 .. opcode:: IMIN - Minimum of Signed Integers
 
 .. math::
 
-  dst.x = min(src0.x, src1.x)
-
-  dst.y = min(src0.y, src1.y)
-
-  dst.z = min(src0.z, src1.z)
-
-  dst.w = min(src0.w, src1.w)
+  dst.x &= min(src0.x, src1.x) \\
+  dst.y &= min(src0.y, src1.y) \\
+  dst.z &= min(src0.z, src1.z) \\
+  dst.w &= min(src0.w, src1.w)
 
 
 .. opcode:: UMIN - Minimum of Unsigned Integers
 
 .. math::
 
-  dst.x = min(src0.x, src1.x)
-
-  dst.y = min(src0.y, src1.y)
-
-  dst.z = min(src0.z, src1.z)
-
-  dst.w = min(src0.w, src1.w)
+  dst.x &= min(src0.x, src1.x) \\
+  dst.y &= min(src0.y, src1.y) \\
+  dst.z &= min(src0.z, src1.z) \\
+  dst.w &= min(src0.w, src1.w)
 
 
 .. opcode:: SHL - Shift Left
@@ -1418,13 +1215,10 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = src0.x << (0x1f \quad \& \quad src1.x)
-
-  dst.y = src0.y << (0x1f \quad \& \quad src1.y)
-
-  dst.z = src0.z << (0x1f \quad \& \quad src1.z)
-
-  dst.w = src0.w << (0x1f \quad \& \quad src1.w)
+  dst.x &= src0.x << (0x1f \quad \& \quad src1.x) \\
+  dst.y &= src0.y << (0x1f \quad \& \quad src1.y) \\
+  dst.z &= src0.z << (0x1f \quad \& \quad src1.z) \\
+  dst.w &= src0.w << (0x1f \quad \& \quad src1.w)
 
 
 .. opcode:: ISHR - Arithmetic Shift Right (of Signed Integer)
@@ -1433,13 +1227,10 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = src0.x >> (0x1f \quad \& \quad src1.x)
-
-  dst.y = src0.y >> (0x1f \quad \& \quad src1.y)
-
-  dst.z = src0.z >> (0x1f \quad \& \quad src1.z)
-
-  dst.w = src0.w >> (0x1f \quad \& \quad src1.w)
+  dst.x &= src0.x >> (0x1f \quad \& \quad src1.x) \\
+  dst.y &= src0.y >> (0x1f \quad \& \quad src1.y) \\
+  dst.z &= src0.z >> (0x1f \quad \& \quad src1.z) \\
+  dst.w &= src0.w >> (0x1f \quad \& \quad src1.w)
 
 
 .. opcode:: USHR - Logical Shift Right
@@ -1448,26 +1239,20 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = src0.x >> (unsigned) (0x1f \quad \& \quad src1.x)
-
-  dst.y = src0.y >> (unsigned) (0x1f \quad \& \quad src1.y)
-
-  dst.z = src0.z >> (unsigned) (0x1f \quad \& \quad src1.z)
-
-  dst.w = src0.w >> (unsigned) (0x1f \quad \& \quad src1.w)
+  dst.x &= src0.x >> (unsigned) (0x1f \quad \& \quad src1.x) \\
+  dst.y &= src0.y >> (unsigned) (0x1f \quad \& \quad src1.y) \\
+  dst.z &= src0.z >> (unsigned) (0x1f \quad \& \quad src1.z) \\
+  dst.w &= src0.w >> (unsigned) (0x1f \quad \& \quad src1.w)
 
 
 .. opcode:: UCMP - Integer Conditional Move
 
 .. math::
 
-  dst.x = src0.x ? \quad src1.x : src2.x
-
-  dst.y = src0.y ? \quad src1.y : src2.y
-
-  dst.z = src0.z ? \quad src1.z : src2.z
-
-  dst.w = src0.w ? \quad src1.w : src2.w
+  dst.x &= src0.x ? \quad src1.x : src2.x \\
+  dst.y &= src0.y ? \quad src1.y : src2.y \\
+  dst.z &= src0.z ? \quad src1.z : src2.z \\
+  dst.w &= src0.w ? \quad src1.w : src2.w
 
 
 
@@ -1475,13 +1260,10 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = (src0.x < 0) ? \quad -1 : ((src0.x > 0) ? \quad 1 : 0)
-
-  dst.y = (src0.y < 0) ? \quad -1 : ((src0.y > 0) ? \quad 1 : 0)
-
-  dst.z = (src0.z < 0) ? \quad -1 : ((src0.z > 0) ? \quad 1 : 0)
-
-  dst.w = (src0.w < 0) ? \quad -1 : ((src0.w > 0) ? \quad 1 : 0)
+  dst.x &= (src0.x < 0) ? \quad -1 : ((src0.x > 0) ? \quad 1 : 0) \\
+  dst.y &= (src0.y < 0) ? \quad -1 : ((src0.y > 0) ? \quad 1 : 0) \\
+  dst.z &= (src0.z < 0) ? \quad -1 : ((src0.z > 0) ? \quad 1 : 0) \\
+  dst.w &= (src0.w < 0) ? \quad -1 : ((src0.w > 0) ? \quad 1 : 0)
 
 
 
@@ -1491,39 +1273,30 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = (src0.x < src1.x) ? \quad \sim 0 : 0
-
-  dst.y = (src0.y < src1.y) ? \quad \sim 0 : 0
-
-  dst.z = (src0.z < src1.z) ? \quad \sim 0 : 0
-
-  dst.w = (src0.w < src1.w) ? \quad \sim 0 : 0
+  dst.x &= (src0.x < src1.x) ? \quad \sim 0 : 0 \\
+  dst.y &= (src0.y < src1.y) ? \quad \sim 0 : 0 \\
+  dst.z &= (src0.z < src1.z) ? \quad \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) ? \quad \sim 0 : 0
-
-  dst.y = (src0.y < src1.y) ? \quad \sim 0 : 0
-
-  dst.z = (src0.z < src1.z) ? \quad \sim 0 : 0
-
-  dst.w = (src0.w < src1.w) ? \quad \sim 0 : 0
+  dst.x &= (src0.x < src1.x) ? \quad \sim 0 : 0 \\
+  dst.y &= (src0.y < src1.y) ? \quad \sim 0 : 0 \\
+  dst.z &= (src0.z < src1.z) ? \quad \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) ? \quad \sim 0 : 0
-
-  dst.y = (src0.y < src1.y) ? \quad \sim 0 : 0
-
-  dst.z = (src0.z < src1.z) ? \quad \sim 0 : 0
-
-  dst.w = (src0.w < src1.w) ? \quad \sim 0 : 0
+  dst.x &= (src0.x < src1.x) ? \quad \sim 0 : 0 \\
+  dst.y &= (src0.y < src1.y) ? \quad \sim 0 : 0 \\
+  dst.z &= (src0.z < src1.z) ? \quad \sim 0 : 0 \\
+  dst.w &= (src0.w < src1.w) ? \quad \sim 0 : 0
 
 
 .. opcode:: FSGE - Float Set On Greater Equal Than (ordered)
@@ -1532,39 +1305,30 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = (src0.x >= src1.x) ? \quad \sim 0 : 0
-
-  dst.y = (src0.y >= src1.y) ? \quad \sim 0 : 0
-
-  dst.z = (src0.z >= src1.z) ? \quad \sim 0 : 0
-
-  dst.w = (src0.w >= src1.w) ? \quad \sim 0 : 0
+  dst.x &= (src0.x >= src1.x) ? \quad \sim 0 : 0 \\
+  dst.y &= (src0.y >= src1.y) ? \quad \sim 0 : 0 \\
+  dst.z &= (src0.z >= src1.z) ? \quad \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) ? \quad \sim 0 : 0
-
-  dst.y = (src0.y >= src1.y) ? \quad \sim 0 : 0
-
-  dst.z = (src0.z >= src1.z) ? \quad \sim 0 : 0
-
-  dst.w = (src0.w >= src1.w) ? \quad \sim 0 : 0
+  dst.x &= (src0.x >= src1.x) ? \quad \sim 0 : 0 \\
+  dst.y &= (src0.y >= src1.y) ? \quad \sim 0 : 0 \\
+  dst.z &= (src0.z >= src1.z) ? \quad \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) ? \quad \sim 0 : 0
-
-  dst.y = (src0.y >= src1.y) ? \quad \sim 0 : 0
-
-  dst.z = (src0.z >= src1.z) ? \quad \sim 0 : 0
-
-  dst.w = (src0.w >= src1.w) ? \quad \sim 0 : 0
+  dst.x &= (src0.x >= src1.x) ? \quad \sim 0 : 0 \\
+  dst.y &= (src0.y >= src1.y) ? \quad \sim 0 : 0 \\
+  dst.z &= (src0.z >= src1.z) ? \quad \sim 0 : 0 \\
+  dst.w &= (src0.w >= src1.w) ? \quad \sim 0 : 0
 
 
 .. opcode:: FSEQ - Float Set On Equal (ordered)
@@ -1573,26 +1337,20 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = (src0.x == src1.x) ? \quad \sim 0 : 0
-
-  dst.y = (src0.y == src1.y) ? \quad \sim 0 : 0
-
-  dst.z = (src0.z == src1.z) ? \quad \sim 0 : 0
-
-  dst.w = (src0.w == src1.w) ? \quad \sim 0 : 0
+  dst.x &= (src0.x == src1.x) ? \quad \sim 0 : 0 \\
+  dst.y &= (src0.y == src1.y) ? \quad \sim 0 : 0 \\
+  dst.z &= (src0.z == src1.z) ? \quad \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) ? \quad \sim 0 : 0
-
-  dst.y = (src0.y == src1.y) ? \quad \sim 0 : 0
-
-  dst.z = (src0.z == src1.z) ? \quad \sim 0 : 0
-
-  dst.w = (src0.w == src1.w) ? \quad \sim 0 : 0
+  dst.x &= (src0.x == src1.x) ? \quad \sim 0 : 0 \\
+  dst.y &= (src0.y == src1.y) ? \quad \sim 0 : 0 \\
+  dst.z &= (src0.z == src1.z) ? \quad \sim 0 : 0 \\
+  dst.w &= (src0.w == src1.w) ? \quad \sim 0 : 0
 
 
 .. opcode:: FSNE - Float Set On Not Equal (unordered)
@@ -1601,26 +1359,20 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = (src0.x != src1.x) ? \quad \sim 0 : 0
-
-  dst.y = (src0.y != src1.y) ? \quad \sim 0 : 0
-
-  dst.z = (src0.z != src1.z) ? \quad \sim 0 : 0
-
-  dst.w = (src0.w != src1.w) ? \quad \sim 0 : 0
+  dst.x &= (src0.x != src1.x) ? \quad \sim 0 : 0 \\
+  dst.y &= (src0.y != src1.y) ? \quad \sim 0 : 0 \\
+  dst.z &= (src0.z != src1.z) ? \quad \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) ? \quad \sim 0 : 0
-
-  dst.y = (src0.y != src1.y) ? \quad \sim 0 : 0
-
-  dst.z = (src0.z != src1.z) ? \quad \sim 0 : 0
-
-  dst.w = (src0.w != src1.w) ? \quad \sim 0 : 0
+  dst.x &= (src0.x != src1.x) ? \quad \sim 0 : 0 \\
+  dst.y &= (src0.y != src1.y) ? \quad \sim 0 : 0 \\
+  dst.z &= (src0.z != src1.z) ? \quad \sim 0 : 0 \\
+  dst.w &= (src0.w != src1.w) ? \quad \sim 0 : 0
 
 
 .. opcode:: INEG - Integer Negate
@@ -1629,26 +1381,20 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?)
 
 .. math::
 
-  dst.x = -src.x
-
-  dst.y = -src.y
-
-  dst.z = -src.z
-
-  dst.w = -src.w
+  dst.x &= -src.x \\
+  dst.y &= -src.y \\
+  dst.z &= -src.z \\
+  dst.w &= -src.w
 
 
 .. opcode:: IABS - Integer Absolute Value
 
 .. math::
 
-  dst.x = |src.x|
-
-  dst.y = |src.y|
-
-  dst.z = |src.z|
-
-  dst.w = |src.w|
+  dst.x &= |src.x| \\
+  dst.y &= |src.y| \\
+  dst.z &= |src.z| \\
+  dst.w &= |src.w|
 
 Bitwise ISA
 ^^^^^^^^^^^
@@ -1933,42 +1679,37 @@ Support for these opcodes is XXX undecided. :T
 
 .. math::
 
-  dst.xy = src0.xy + src1.xy
-
-  dst.zw = src0.zw + src1.zw
+  dst.xy &= src0.xy + src1.xy \\
+  dst.zw &= src0.zw + src1.zw
 
 
 .. opcode:: DDIV - Divide
 
 .. math::
 
-  dst.xy = \frac{src0.xy}{src1.xy}
-
-  dst.zw = \frac{src0.zw}{src1.zw}
+  dst.xy &= \frac{src0.xy}{src1.xy} \\
+  dst.zw &= \frac{src0.zw}{src1.zw}
 
 .. opcode:: DSEQ - Set on Equal
 
 .. math::
 
-  dst.xy = src0.xy == src1.xy ? \quad 1.0F : 0.0F
-
-  dst.zw = src0.zw == src1.zw ? \quad 1.0F : 0.0F
+  dst.xy &= src0.xy == src1.xy ? \quad 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 ? \quad 1.0F : 0.0F
-
-  dst.zw = src0.zw < src1.zw ? \quad 1.0F : 0.0F
+  dst.xy &= src0.xy < src1.xy ? \quad 1.0F : 0.0F \\
+  dst.zw &= src0.zw < src1.zw ? \quad 1.0F : 0.0F
 
 .. opcode:: DFRAC - Fraction
 
 .. math::
 
-  dst.xy = src.xy - \lfloor src.xy\rfloor
-
-  dst.zw = src.zw - \lfloor src.zw\rfloor
+  dst.xy &= src.xy - \lfloor src.xy\rfloor \\
+  dst.zw &= src.zw - \lfloor src.zw\rfloor
 
 
 .. opcode:: DFRACEXP - Convert Number to Fractional and Integral Components
@@ -1979,13 +1720,10 @@ exponent of its source to ``dst0``, and the significand to ``dst1``, such that
 
 .. math::
 
-  dst0.xy = exp(src.xy)
-
-  dst1.xy = frac(src.xy)
-
-  dst0.zw = exp(src.zw)
-
-  dst1.zw = frac(src.zw)
+  dst0.xy &= exp(src.xy)  \\
+  dst1.xy &= frac(src.xy) \\
+  dst0.zw &= exp(src.zw)  \\
+  dst1.zw &= frac(src.zw)
 
 .. opcode:: DLDEXP - Multiply Number by Integral Power of 2
 
@@ -1993,59 +1731,52 @@ This opcode is the inverse of :opcode:`DFRACEXP`.
 
 .. math::
 
-  dst.xy = src0.xy \times 2^{src1.xy}
-
-  dst.zw = src0.zw \times 2^{src1.zw}
+  dst.xy &= src0.xy \times 2^{src1.xy} \\
+  dst.zw &= src0.zw \times 2^{src1.zw}
 
 .. opcode:: DMIN - Minimum
 
 .. math::
 
-  dst.xy = min(src0.xy, src1.xy)
-
-  dst.zw = min(src0.zw, src1.zw)
+  dst.xy &= min(src0.xy, src1.xy) \\
+  dst.zw &= min(src0.zw, src1.zw)
 
 .. opcode:: DMAX - Maximum
 
 .. math::
 
-  dst.xy = max(src0.xy, src1.xy)
-
-  dst.zw = max(src0.zw, src1.zw)
+  dst.xy &= max(src0.xy, src1.xy) \\
+  dst.zw &= max(src0.zw, src1.zw)
 
 .. opcode:: DMUL - Multiply
 
 .. math::
 
-  dst.xy = src0.xy \times src1.xy
-
-  dst.zw = src0.zw \times src1.zw
+  dst.xy &= src0.xy \times src1.xy \\
+  dst.zw &= src0.zw \times src1.zw
 
 
 .. opcode:: DMAD - Multiply And Add
 
 .. math::
 
-  dst.xy = src0.xy \times src1.xy + src2.xy
-
-  dst.zw = src0.zw \times src1.zw + src2.zw
+  dst.xy &= src0.xy \times src1.xy + src2.xy \\
+  dst.zw &= src0.zw \times src1.zw + src2.zw
 
 
 .. opcode:: DRCP - Reciprocal
 
 .. math::
 
-   dst.xy = \frac{1}{src.xy}
-
-   dst.zw = \frac{1}{src.zw}
+   dst.xy &= \frac{1}{src.xy} \\
+   dst.zw &= \frac{1}{src.zw}
 
 .. opcode:: DSQRT - Square Root
 
 .. math::
 
-   dst.xy = \sqrt{src.xy}
-
-   dst.zw = \sqrt{src.zw}
+   dst.xy &= \sqrt{src.xy} \\
+   dst.zw &= \sqrt{src.zw}
 
 
 .. _samplingopcodes:
@@ -2350,9 +2081,8 @@ For the moment they're only valid in compute programs.
 
 .. math::
 
-  dst_i = resource[offset]_i
-
-  resource[offset]_i = dst_i + src_i
+  dst_i &= resource[offset]_i \\
+  resource[offset]_i &= dst_i + src_i
 
 
 .. opcode:: ATOMXCHG - Atomic exchange
@@ -2365,9 +2095,8 @@ For the moment they're only valid in compute programs.
 
 .. math::
 
-  dst_i = resource[offset]_i
-
-  resource[offset]_i = src_i
+  dst_i &= resource[offset]_i \\
+  resource[offset]_i &= src_i
 
 
 .. opcode:: ATOMCAS - Atomic compare-and-exchange
@@ -2380,9 +2109,8 @@ For the moment they're only valid in compute programs.
 
 .. math::
 
-  dst_i = resource[offset]_i
-
-  resource[offset]_i = (dst_i == cmp_i ? \quad src_i : dst_i)
+  dst_i &= resource[offset]_i \\
+  resource[offset]_i &= (dst_i == cmp_i ? \quad src_i : dst_i)
 
 
 .. opcode:: ATOMAND - Atomic bitwise And
@@ -2395,9 +2123,8 @@ For the moment they're only valid in compute programs.
 
 .. math::
 
-  dst_i = resource[offset]_i
-
-  resource[offset]_i = dst_i \& src_i
+  dst_i &= resource[offset]_i \\
+  resource[offset]_i &= dst_i \& src_i
 
 
 .. opcode:: ATOMOR - Atomic bitwise Or
@@ -2410,9 +2137,8 @@ For the moment they're only valid in compute programs.
 
 .. math::
 
-  dst_i = resource[offset]_i
-
-  resource[offset]_i = dst_i | src_i
+  dst_i &= resource[offset]_i \\
+  resource[offset]_i &= dst_i | src_i
 
 
 .. opcode:: ATOMXOR - Atomic bitwise Xor
@@ -2425,9 +2151,8 @@ For the moment they're only valid in compute programs.
 
 .. math::
 
-  dst_i = resource[offset]_i
-
-  resource[offset]_i = dst_i \oplus src_i
+  dst_i &= resource[offset]_i \\
+  resource[offset]_i &= dst_i \oplus src_i
 
 
 .. opcode:: ATOMUMIN - Atomic unsigned minimum
@@ -2440,9 +2165,8 @@ For the moment they're only valid in compute programs.
 
 .. math::
 
-  dst_i = resource[offset]_i
-
-  resource[offset]_i = (dst_i < src_i ? \quad dst_i : src_i)
+  dst_i &= resource[offset]_i \\
+  resource[offset]_i &= (dst_i < src_i ? \quad dst_i : src_i)
 
 
 .. opcode:: ATOMUMAX - Atomic unsigned maximum
@@ -2455,9 +2179,8 @@ For the moment they're only valid in compute programs.
 
 .. math::
 
-  dst_i = resource[offset]_i
-
-  resource[offset]_i = (dst_i > src_i ? \quad dst_i : src_i)
+  dst_i &= resource[offset]_i \\
+  resource[offset]_i &= (dst_i > src_i ? \quad dst_i : src_i)
 
 
 .. opcode:: ATOMIMIN - Atomic signed minimum
@@ -2470,9 +2193,8 @@ For the moment they're only valid in compute programs.
 
 .. math::
 
-  dst_i = resource[offset]_i
-
-  resource[offset]_i = (dst_i < src_i ? \quad dst_i : src_i)
+  dst_i &= resource[offset]_i \\
+  resource[offset]_i &= (dst_i < src_i ? \quad dst_i : src_i)
 
 
 .. opcode:: ATOMIMAX - Atomic signed maximum
@@ -2485,9 +2207,8 @@ For the moment they're only valid in compute programs.
 
 .. math::
 
-  dst_i = resource[offset]_i
-
-  resource[offset]_i = (dst_i > src_i ? \quad dst_i : src_i)
+  dst_i &= resource[offset]_i \\
+  resource[offset]_i &= (dst_i > src_i ? \quad dst_i : src_i)
 
 
 
-- 
1.7.3.4



More information about the mesa-dev mailing list