Instruction Modifiers#

Modifier Name

Description

.ABS

Take the absolute value.

See below this table for code examples.

.ARRAY

Enable texture arrays.

See below this table for code examples.

.CLAMP

Clamp is applied after absolute, but before negation.

Clamps value to range [+0,1].

.COMPARISON

Enable comparison filtering in TPU.

.DIRECT

Direct DMA instruction, bypassing the main ALU pipeline

.E0

Element selector for operations that operate on types narrower than 32-bit. This will normally be preceded by the data type (f16 etc.).

For source, selects the part of the argument that forms an element.

For destination, broadcasts the result to these elements of destination.

Reads from: bits 0-7.

.E1

Reads from: bits 8-15.

.E2

Reads from: bits 16-23.

.E3

Reads from: bits 24-31.

.F16

Return packed F16 data.

.F32

Return packed F32 data.

.FCNORM

Fixed point texture data, converted to floating point when returned to USC.

See below this table for code examples.

.FLR

Take the floor part (before absolute/negate), NaN’s, +/-inf and +/-0.0f are all preserved.

See below this table for code examples.

.INTEGER

[U], [V] , [S], [T] and [Q] Sample Data are treated as integers.

[.LODM]

LOD Mode possible values: .BIAS, .REPLACE, or .GRADIENT.

.LP

Low Precision.

.NEG

Negate.

See below this table for code examples.

.NNCOORDS

Non Normalised Coordinates.

.ONEMINUS

x = 1 - x

.PPLOD

Per Pixel LOD is enabled - only valid when LODM = Bias or Replace.

.PROJ

Per Pixel LOD is enabled - only valid when LODM = Bias or Replace

.ROUNDZERO

Round value to zero.

.SAT

Saturate iterated coordinates to 0.0..1.0.

See below this table for code examples.

[.SBMode]

Sample Bypass Mode possible values: .DATA, .INFO, or .BOTH.

See below this table for code examples.

.SNO

Sample Number is supplied.

.SOO

Sample Offset is supplied.

See below this table for code examples.

.TAO

Texture Address Override.

[.type]

Data type possible values: .F32, .U16, .S16, .U8, .S8, .U32, or .S32.

.ZABS

Absolute modifier for the toF16 operand of the Z term.

.ZCLAMP

Clamp bit for the toF16 operand of the Z term.

.ABS code example:

void main()
{
  fragmentColor = abs(a);
}
0  : mov ft0, sh0.abs
     mov ft1, sh1.abs
     mov r0, ft0;
     mov r1, ft1;

.ARRAY code example:

uniform highp sampler2DArray sampler;

void main()
{
    fragmentColor = texture(sampler,
                vec3(textureCoordinate, 0.0));
}
3    : smp2d.fcnorm.array drc0, sh4, r1, sh0, _, r0, 4;

.FCNORM code example:

void main()
{
   fragmentColor = texture(sampler,  ntextureCoordinate);
}
0    : (ignorepe)
{
   itrsmp2d.pixel.fcnorm.schedwdf
   r0, 1, drc0, cf4, sh4, sh0, 4,
   cf0,
}

.FLR code example:

void main()
{
    fragmentColor =
       floor(a);
}
0    : fadd ft0, sh0.flr, c0
       fadd ft1, sh1.flr, c0
       mov r0, ft0;
       mov r1, ft1;

.NEG code example:

void main()
{
    fragmentColor = -a;
}
0    : mov ft0, sh0.neg
       mov ft1, sh1.neg
       mov r0, ft0;
       mov r1, ft1;

.SAT code example:

void main()
{
    fragmentColor =
        clamp(a, 0.0, 1.0);
}
0    : fadd.sat ft0, sh0, c0
       fadd.sat ft1, sh1, c0
       mov r0, ft0;
       mov r1, ft1;

.SBMode code example:

uniform highp sampler2DShadow sampler;

void main()
{
    fragmentColor = vec4(texture(sampler,
            vec3(textureCoordinate,
            0.0)));
}
11   : smp2d.fcnorm.both drc0, sh12, r1, sh4, _, r0, 1;

.SOO code example:

void main()
{
   fragmentColor =
     textureOffset(sampler,
     textureCoordinate, ivec2(1, 1));
}
9    : if(!p0)
{
  smp2d.fcnorm.soo drc0,
   sh8, r32, sh0, _, r0, 4;
}