Instruction Modifiers

A list of instruction modifiers which can be on PowerVR GPUs

Modifier Name

Description

.ABS

Take the absolute value

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

.ARRAY

Enable texture arrays

Table 2. Example:
uniform highp sampler2DArray sampler;

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

.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

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

.FLR

Take the floor part (before absolute/negate), NaN's, +/-inf and +/-0.0f are all preserved
Table 4. Example:
void main()
{
    fragmentColor =  
       floor(a);
}
0    : fadd ft0, sh0.flr, c0
       fadd ft1, sh1.flr, c0
       mov r0, ft0;
       mov r1, ft1;

.INTEGER

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

[.LODM]

LOD Mode possible values:

-.BIAS

-.REPLACE

-.GRADIENT

.LP

Low Precision

.NEG

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

.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

Table 6. 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]

Sample Bypass Mode possible values:

-.DATA

-.INFO

-.BOTH

Table 7. 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;

.SNO

Sample Number is supplied

.SOO

Sample Offset is supplied

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

.TAO

Texture Address Override

[.type]

Data type possible values:

-.F32

-.U16

-.S16

-.U8

-.S8

-.U32

-.S32

.ZABS

Absolute modifier for the toF16 operand of the Z term

.ZCLAMP

Clamp bit for the toF16 operand of the Z term