Merge branch 'asm-shader-rework-2'
[mesa.git] / src / gallium / auxiliary / tgsi / tgsi-instruction-set.txt
index 5b21a2be0bd7feb3e5f2da10bd363de8fbda3434..eb492076b7d2dcaf935d5bdc30406fac0327d762 100644 (file)
@@ -187,11 +187,7 @@ TGSI Instruction Specification
 
 1.2.6  CND0 - Condition Zero
 
-  dst.x = (src2.x >= 0.0) ? src0.x : src1.x
-  dst.y = (src2.y >= 0.0) ? src0.y : src1.y
-  dst.z = (src2.z >= 0.0) ? src0.z : src1.z
-  dst.w = (src2.w >= 0.0) ? src0.w : src1.w
-
+       Removed.  Use (CMP src2, src1, src0) instead.
 
 1.2.7  DOT2ADD - 2-component Dot Product And Add
 
@@ -262,7 +258,7 @@ TGSI Instruction Specification
   dst.w = round(src.w)
 
 
-1.3.10  EXPBASE2 - Exponent Base 2
+1.3.10  EXPBASE2 - Exponential Base 2
 
   dst.x = pow(2.0, src.x)
   dst.y = pow(2.0, src.x)
@@ -382,9 +378,7 @@ TGSI Instruction Specification
 
 1.5.7  KILP - Predicated Discard
 
-  if (cc.x || cc.y || cc.z || cc.w)
-    discard
-  endif
+  discard
 
 
 1.5.8  LG2 - Logarithm Base 2
@@ -548,7 +542,7 @@ TGSI Instruction Specification
 
 1.6.3  BRA - Branch
 
-  TBD
+  pc = target
 
 
 1.6.4  CAL - Subroutine Call
@@ -667,9 +661,18 @@ TGSI Instruction Specification
   TBD
 
 
-1.9.8  LOOP - Loop
+1.9.8  BGNFOR - Begin a For-Loop
 
-  TBD
+  dst.x = floor(src.x)
+  dst.y = floor(src.y)
+  dst.z = floor(src.z)
+
+  if (dst.y <= 0)
+    pc = [matching ENDFOR] + 1
+  endif
+
+  Note: The destination must be a loop register.
+        The source must be a constant register.
 
 
 1.9.9  REP - Repeat
@@ -687,9 +690,16 @@ TGSI Instruction Specification
   TBD
 
 
-1.9.12  ENDLOOP - End Loop
+1.9.12  ENDFOR - End a For-Loop
 
-  TBD
+  dst.x = dst.x + dst.z
+  dst.y = dst.y - 1.0
+
+  if (dst.y > 0)
+    pc = [matching BGNFOR instruction] + 1
+  endif
+
+  Note: The destination must be a loop register.
 
 
 1.9.13  ENDREP - End Repeat
@@ -842,7 +852,7 @@ TGSI Instruction Specification
 ----------
 
 
-1.13.1  BGNLOOP2 - Begin Loop
+1.13.1  BGNLOOP - Begin a Loop
 
   TBD
 
@@ -852,7 +862,7 @@ TGSI Instruction Specification
   TBD
 
 
-1.13.3  ENDLOOP2 - End Loop
+1.13.3  ENDLOOP - End a Loop
 
   TBD
 
@@ -1017,12 +1027,12 @@ TGSI Instruction Specification
 
 1.18.1  EXPP - Approximate Exponential Base 2
 
-  Alias for EXP.
+  Use EXP. See also 1.19.3.
 
 
 1.18.2  LOGP - Logarithm Base 2
 
-  Alias for LG2.
+  Use LOG. See also 1.19.4.
 
 
 1.19  vs_2_0
@@ -1038,3 +1048,84 @@ TGSI Instruction Specification
 
   Alias for ARR.
 
+
+1.19.3  EXPP - Approximate Exponential Base 2
+
+  Use EX2.
+
+
+1.19.4  LOGP - Logarithm Base 2
+
+  Use LG2.
+
+
+2  Explanation of symbols used
+==============================
+
+
+2.1  Functions
+--------------
+
+
+  abs(x)            Absolute value of x.
+                    |x|
+                    (x < 0.0) ? -x : x
+
+  ceil(x)           Ceiling of x.
+
+  clamp(x,y,z)      Clamp x between y and z.
+                    (x < y) ? y : (x > z) ? z : x
+
+  cos(x)            Cosine of x.
+
+  floor(x)          Floor of x.
+
+  lg2(x)            Logarithm base 2 of x.
+
+  max(x,y)          Maximum of x and y.
+                    (x > y) ? x : y
+
+  min(x,y)          Minimum of x and y.
+                    (x < y) ? x : y
+
+  partialx(x)       Derivative of x relative to fragment's X.
+
+  partialy(x)       Derivative of x relative to fragment's Y.
+
+  pop()             Pop from stack.
+
+  pow(x,y)          Raise x to power of y.
+
+  push(x)           Push x on stack.
+
+  round(x)          Round x.
+
+  sin(x)            Sine of x.
+
+  sqrt(x)           Square root of x.
+
+  trunc(x)          Truncate x.
+
+
+2.2  Keywords
+-------------
+
+
+  discard           Discard fragment.
+
+  dst               First destination register.
+
+  dst0              First destination register.
+
+  pc                Program counter.
+
+  src               First source register.
+
+  src0              First source register.
+
+  src1              Second source register.
+
+  src2              Third source register.
+
+  target            Label of target instruction.
+