vISA SVM_SCATTER
intel_gpu_visa)Intel Gen9–Gen12 / Xe-LP / Xe-HPG / Xe-HPC / Xe2
master
userBDW, SKL, BXT, ICLLP, TGLLPSummary
Intel GPU vISA SVM_SCATTER instruction.
Syntax / Encoding
[(<P>)] SVM_SCATTER.<block_size>.<num_blocks> (<exec_size>) <addresses> <src>
Binary Encodings (1)
| Width | Format | Bit Pattern | Mask / Match |
|---|---|---|---|
| Intel-vISA | | / |
Operands
| Name | Description |
|---|---|
Exec_size | Execution size |
Pred | Predication control |
Addresses | The general variable storing the addresses to write. The first 8 elements of the operand will be used as the virtual addresses to write to, and they are in the unit of bytes. Each address must be aligned to the Block. Must have type UQ |
Src | The general variable providing the values to be written to each address. Its format depends on <block_size> and <num_blocks> |
Reference Notes
## Opcode
SVM = 0x4e
SCATTER = 0x04
## Format
| | | | | | | |
| --- | --- | --- | --- | --- | --- | --- |
| 0x4e(SVM) | 0x04(SCATTER) | Exec_size | Pred | Block_size | Num_blocks | Addresses | Src |
## Semantics
```
for (i = 0; i < exec_size; ++i) {
if (ChEn[i]) {
if (block_size == 4 || block_size == 8) {
for (j = 0; j < num_blocks; ++j) {
*(Addresses[i] + j*block_size) = src[j*exec_size+i]; //4 or 8 byte
}
}
else { // block_size == 1
for (j = 0; j < num_blocks; ++j) {
UD min_block_size = num_blocks < 4 ? 4 : num_blocks;
*(Addresses[i] + j) = src[i*min_block_size+j]; //1 byte
}
}
}
}
```
## Description
```
Performs 8 element scattered write to virtual addresses, taking the
values from <src>. Each element may have multiple blocks.
```
- **Exec_size(ub):** Execution size
- Bit[2..0]: size of the region for source and destination operands
- 0b000: 1 element (scalar)
- 0b001: 2 elements
- 0b010: 4 elements
- 0b011: 8 elements
- 0b100: 16 elements
- Bit[7..4]: execution mask (explicit control over the enabled channels)
- 0b0000: M1
- 0b0001: M2
- 0b0010: M3
- 0b0011: M4
- 0b0100: M5
- 0b0101: M6
- 0b0110: M7
- 0b0111: M8
- 0b1000: M1_NM
- 0b1001: M2_NM
- 0b1010: M3_NM
- 0b1011: M4_NM
- 0b1100: M5_NM
- 0b1101: M6_NM
- 0b1110: M7_NM
- 0b1111: M8_NM
- **Pred(uw):** Predication control
- **Block_size(ub):**
- Bit[1..0]: encodes the byte size of each block
- 0b00: 1 byte
- 0b01: 4 byte
- 0b10: 8 byte
- **Num_blocks(ub):**
- Bit[1..0]: encodes the number of blocks to read for each address
- 0b00: 1 block
- 0b01: 2 blocks
- 0b10: 4 blocks
- 0b11: 8 blocks. It is only valid for 4 byte blocks and execution size 8
- **Addresses(raw_operand):** The general variable storing the addresses to write. The first 8 elements of the operand will be used as the virtual addresses to write to, and they are in the unit of bytes. Each address must be aligned to the Block. Must have type UQ
- **Src(raw_operand):** The general variable providing the values to be written to each address. Its format depends on <block_size> and <num_blocks>
#### Properties
## Text
```
[(<P>)] SVM_SCATTER.<block_size>.<num_blocks> (<exec_size>) <addresses> <src>
```
## Notes
```
4 byte scatter:
+-----------------+-----------------+----+----+-----+----+----+-----------------+
| A0[0] | A1[0] | | | ... | | | A7[0] |
+-----------------+-----------------+----+----+-----+----+----+-----------------+
| ... |
+-----------------+-----------------+----+----+-----+----+----+-----------------+
| A0[#blocks-1] | A1[#blocks-1] | | | ... | | | A7[#blocks-1] |
+-----------------+-----------------+----+----+-----+----+----+-----------------+
8 byte scatter:
+-----------------+-----------------+-----------------+-----------------+
| A0[0] | A1[0] | A2[0] | A3[0] |
+-----------------+-----------------+-----------------+-----------------+
| A4[0] | A5[0] | A6[0] | A7[0] |
+-----------------+-----------------+-----------------+-----------------+
| ... |
+-----------------+-----------------+-----------------+-----------------+
| A0[#blocks-1] | A1[#blocks-1] | A2[#blocks-1] | A3[#blocks-1] |
+-----------------+-----------------+-----------------+-----------------+
| A4[#blocks-1] | A5[#blocks-1] | A6[#blocks-1] | A7[#blocks-1] |
+-----------------+-----------------+-----------------+-----------------+
1 byte scatter, 1/2/4 block (Ai[N] is ignored if N>= num_blocks)
+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+
| A0[0:3] | A1[0:3] | A2[0:3] | A3[0:3] | A4[0:3] | A5[0:3] | A6[0:3] | A7[0:3] |
+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+
1 byte scatter, 8 block
+-----------+-----------+-----------+-----------+
| A0[0:7] | A1[0:7] | A2[0:7] | A3[0:7] |
+-----------+-----------+-----------+-----------+
| A4[0:7] | A5[0:7] | A6[0:7] | A7[0:7] |
+-----------+-----------+-----------+-----------+
Each table row represents one GRF, and A0[0] corresponds to the
first element in <src> in all of the above tables. The operand's
type must be the same size as <block_size>.
Note that: When num_blocks > 1, exec_size must >= 8.
```