radeong: Provide drm_api::destroy hook.
[mesa.git] / src / gallium / auxiliary / tgsi / tgsi-instruction-set.txt
index e2bdb78a3f7e7465b3a97d322966229c2b2bee1e..080fd4c7310dc53647aaf6d837ba40706ee97527 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,7 +378,7 @@ TGSI Instruction Specification
 
 1.5.7  KILP - Predicated Discard
 
-  TBD
+  discard
 
 
 1.5.8  LG2 - Logarithm Base 2
@@ -546,7 +542,7 @@ TGSI Instruction Specification
 
 1.6.3  BRA - Branch
 
-  TBD
+  pc = target
 
 
 1.6.4  CAL - Subroutine Call
@@ -599,7 +595,9 @@ TGSI Instruction Specification
 
 1.8.2  KIL - Conditional Discard
 
-  TBD
+  if (src.x < 0.0 || src.y < 0.0 || src.z < 0.0 || src.w < 0.0)
+    discard
+  endif
 
 
 1.8.3  SCS - Sine Cosine
@@ -614,3 +612,552 @@ TGSI Instruction Specification
 
   TBD
 
+
+1.9  GL_NV_fragment_program2
+----------------------------
+
+
+1.9.1  NRM - 3-component Vector Normalise
+
+  dst.x = src.x / (src.x * src.x + src.y * src.y + src.z * src.z)
+  dst.y = src.y / (src.x * src.x + src.y * src.y + src.z * src.z)
+  dst.z = src.z / (src.x * src.x + src.y * src.y + src.z * src.z)
+  dst.w = 1.0
+
+
+1.9.2  DIV - Divide
+
+  dst.x = src0.x / src1.x
+  dst.y = src0.y / src1.y
+  dst.z = src0.z / src1.z
+  dst.w = src0.w / src1.w
+
+
+1.9.3  DP2 - 2-component Dot Product
+
+  dst.x = src0.x * src1.x + src0.y * src1.y
+  dst.y = src0.x * src1.x + src0.y * src1.y
+  dst.z = src0.x * src1.x + src0.y * src1.y
+  dst.w = src0.x * src1.x + src0.y * src1.y
+
+
+1.9.4  DP2A - 2-component Dot Product And Add
+
+  Alias for DOT2ADD.
+
+
+1.9.5  TXL - Texture Lookup With LOD
+
+  TBD
+
+
+1.9.6  BRK - Break
+
+  TBD
+
+
+1.9.7  IF - If
+
+  TBD
+
+
+1.9.8  BGNFOR - Begin a For-Loop
+
+  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
+
+  TBD
+
+
+1.9.10  ELSE - Else
+
+  TBD
+
+
+1.9.11  ENDIF - End If
+
+  TBD
+
+
+1.9.12  ENDFOR - End a For-Loop
+
+  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
+
+  TBD
+
+
+1.10  GL_NV_vertex_program3
+---------------------------
+
+
+1.10.1  PUSHA - Push Address Register On Stack
+
+  push(src.x)
+  push(src.y)
+  push(src.z)
+  push(src.w)
+
+
+1.10.2  POPA - Pop Address Register From Stack
+
+  dst.w = pop()
+  dst.z = pop()
+  dst.y = pop()
+  dst.x = pop()
+
+
+1.11  GL_NV_gpu_program4
+------------------------
+
+
+1.11.1  CEIL - Ceiling
+
+  dst.x = ceil(src.x)
+  dst.y = ceil(src.y)
+  dst.z = ceil(src.z)
+  dst.w = ceil(src.w)
+
+
+1.11.2  I2F - Integer To Float
+
+  dst.x = (float) src.x
+  dst.y = (float) src.y
+  dst.z = (float) src.z
+  dst.w = (float) src.w
+
+
+1.11.3  NOT - Bitwise Not
+
+  dst.x = ~src.x
+  dst.y = ~src.y
+  dst.z = ~src.z
+  dst.w = ~src.w
+
+
+1.11.4  TRUNC - Truncate
+
+  dst.x = trunc(src.x)
+  dst.y = trunc(src.y)
+  dst.z = trunc(src.z)
+  dst.w = trunc(src.w)
+
+
+1.11.5  SHL - Shift Left
+
+  dst.x = src0.x << src1.x
+  dst.y = src0.y << src1.x
+  dst.z = src0.z << src1.x
+  dst.w = src0.w << src1.x
+
+
+1.11.6  SHR - Shift Right
+
+  dst.x = src0.x >> src1.x
+  dst.y = src0.y >> src1.x
+  dst.z = src0.z >> src1.x
+  dst.w = src0.w >> src1.x
+
+
+1.11.7  AND - Bitwise And
+
+  dst.x = src0.x & src1.x
+  dst.y = src0.y & src1.y
+  dst.z = src0.z & src1.z
+  dst.w = src0.w & src1.w
+
+
+1.11.8  OR - Bitwise Or
+
+  dst.x = src0.x | src1.x
+  dst.y = src0.y | src1.y
+  dst.z = src0.z | src1.z
+  dst.w = src0.w | src1.w
+
+
+1.11.9  MOD - Modulus
+
+  dst.x = src0.x % src1.x
+  dst.y = src0.y % src1.y
+  dst.z = src0.z % src1.z
+  dst.w = src0.w % src1.w
+
+
+1.11.10  XOR - Bitwise Xor
+
+  dst.x = src0.x ^ src1.x
+  dst.y = src0.y ^ src1.y
+  dst.z = src0.z ^ src1.z
+  dst.w = src0.w ^ src1.w
+
+
+1.11.11  SAD - Sum Of Absolute Differences
+
+  dst.x = abs(src0.x - src1.x) + src2.x
+  dst.y = abs(src0.y - src1.y) + src2.y
+  dst.z = abs(src0.z - src1.z) + src2.z
+  dst.w = abs(src0.w - src1.w) + src2.w
+
+
+1.11.12  TXF - Texel Fetch
+
+  TBD
+
+
+1.11.13  TXQ - Texture Size Query
+
+  TBD
+
+
+1.11.14  CONT - Continue
+
+  TBD
+
+
+1.12  GL_NV_geometry_program4
+-----------------------------
+
+
+1.12.1  EMIT - Emit
+
+  TBD
+
+
+1.12.2  ENDPRIM - End Primitive
+
+  TBD
+
+
+1.13  GLSL
+----------
+
+
+1.13.1  BGNLOOP - Begin a Loop
+
+  TBD
+
+
+1.13.2  BGNSUB - Begin Subroutine
+
+  TBD
+
+
+1.13.3  ENDLOOP - End a Loop
+
+  TBD
+
+
+1.13.4  ENDSUB - End Subroutine
+
+  TBD
+
+
+1.13.5  INT - Truncate
+
+  Alias for TRUNC.
+
+
+1.13.6  NOISE1 - 1D Noise
+
+  TBD
+
+
+1.13.7  NOISE2 - 2D Noise
+
+  TBD
+
+
+1.13.8  NOISE3 - 3D Noise
+
+  TBD
+
+
+1.13.9  NOISE4 - 4D Noise
+
+  TBD
+
+
+1.13.10  NOP - No Operation
+
+  Do nothing.
+
+
+1.14  ps_1_1
+------------
+
+
+1.14.1  TEXKILL - Conditional Discard
+
+  Alias for KIL.
+
+
+1.15  ps_1_4
+------------
+
+
+1.15.1  TEXLD - Texture Lookup
+
+  Alias for TEX.
+
+
+1.16  ps_2_0
+------------
+
+
+1.16.1  M4X4 - Multiply Matrix
+
+  Alias for MULTIPLYMATRIX.
+
+
+1.16.2  M4X3 - Multiply Matrix
+
+  Considered for removal from language.
+
+
+1.16.3  M3X4 - Multiply Matrix
+
+  Considered for removal from language.
+
+
+1.16.4  M3X3 - Multiply Matrix
+
+  Considered for removal from language.
+
+
+1.16.5  M3X2 - Multiply Matrix
+
+  Considered for removal from language.
+
+
+1.16.6  CRS - Cross Product
+
+  Alias for XPD.
+
+
+1.16.7  NRM4 - 4-component Vector Normalise
+
+  dst.x = src.x / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w)
+  dst.y = src.y / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w)
+  dst.z = src.z / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w)
+  dst.w = src.w / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w)
+
+
+1.16.8  SINCOS - Sine Cosine
+
+  Alias for SCS.
+
+
+1.16.9  TEXLDB - Texture Lookup With Bias
+
+  Alias for TXB.
+
+
+1.16.10  DP2ADD - 2-component Dot Product And Add
+
+  Alias for DP2A.
+
+
+1.17  ps_2_x
+------------
+
+
+1.17.1  CALL - Subroutine Call
+
+  Alias for CAL.
+
+
+1.17.2  CALLNZ - Subroutine Call If Not Zero
+
+  TBD
+
+
+1.17.3  IFC - If
+
+  TBD
+
+
+1.17.4  BREAK - Break
+
+  Alias for BRK.
+
+
+1.17.5  BREAKC - Break Conditional
+
+  TBD
+
+
+1.17.6  DSX - Derivative Relative To X
+
+  Alias for DDX.
+
+
+1.17.7  DSY - Derivative Relative To Y
+
+  Alias for DDY.
+
+
+1.17.8  TEXLDD - Texture Lookup with Derivatives
+
+  Alias for TXD.
+
+
+1.18  vs_1_1
+------------
+
+
+1.18.1  EXPP - Approximate Exponential Base 2
+
+  Use EXP. See also 1.19.3.
+
+
+1.18.2  LOGP - Logarithm Base 2
+
+  Use LOG. See also 1.19.4.
+
+
+1.19  vs_2_0
+------------
+
+
+1.19.1  SGN - Set Sign
+
+  Alias for SSG.
+
+
+1.19.2  MOVA - Move Address Register
+
+  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.
+
+
+3  Other tokens
+===============
+
+
+3.1  Declaration Semantic
+-------------------------
+
+
+  Follows Declaration token if Semantic bit is set.
+
+  Since its purpose is to link a shader with other stages of the pipeline,
+  it is valid to follow only those Declaration tokens that declare a register
+  either in INPUT or OUTPUT file.
+
+  SemanticName field contains the semantic name of the register being declared.
+  There is no default value.
+
+  SemanticIndex is an optional subscript that can be used to distinguish
+  different register declarations with the same semantic name. The default value
+  is 0.
+
+  The meanings of the individual semantic names are explained in the following
+  sections.
+
+
+3.1.1  FACE
+
+  Valid only in a fragment shader INPUT declaration.
+
+  FACE.x is negative when the primitive is back facing. FACE.x is positive
+  when the primitive is front facing.