Special Registers

4. Special Registers#

Special registers are predefined variables within PISA virtual machine. They can be accessed anywhere within a PISA program. They may either be programmed by the driver prior to kernel launch (e.g. %globaloffset) or may be updated by hardware to reflect current execution state (e.g. %activemask).

Special registers with 3-element vector data types (e.g. .v3.32b) provide a way to access per-dimension values. Individual elements can be accessed using swizzle syntax.

  • .x - specifies the value along x dimension

  • .y - specifies the value along y dimension

  • .z - specifies the value along z dimension

Important

Special registers with a vector type are accessed one element at a time via the .x / .y / .z swizzle only. The .w and multi-element swizzles (.xy, .zw, .xyzw) are not supported, and they cannot be used as whole-vector operands (e.g. with extract / insert).

Note

Unless specified otherwise, special registers are read-only and carry unsigned data.

Special Registers#

Name

Type

Description

%activemask

.32b

Indicates whether the corresponding work-item within the sub-group is currently active (1 bit per work-item; 1 = active, 0 = inactive). Implicitly updated by control-flow instructions.

%enqueuedlocalsize

.v3.32b

Specifies the number of work-items per work-group requested at kernel dispatch.

%globaloffset

.v3.64b

Specifies the global offset of the work-item.

%globalsize

.v3.64b

Specifies the number of global work-items.

%groupcount

.v3.32b

Specifies the work-group count.

%groupid

.v3.32b

Specifies the work-group ID.

%laneid

.32b

Specifies the work-item ID within a sub-group.

%localid

.v3.32b

Specifies the work-item ID within a work-group.

%localsize

.v3.32b

Specifies the work-group size.

%printfbuffer

.64b

Holds the address of the printf buffer.

%subgroupsize

.32b

Specifies the size of a sub-group. Current PISA specification fixes this value at 32.

%workdim

.32b

Specifies the number of dimensions in use for the kernel dispatch.