SHIFTXB
tenstorrent_tt_isa)Tenstorrent Wormhole B0 & Blackhole A0
main
userTensix, Matrix Unit, WormholeB0Summary
One row of SrcB is either rotated left by one lane, or shifted left by one lane and the rightmost lane set to zero.
Syntax / Encoding
TT_SHIFTXB(/* u2 */ AddrMod,
/* bool */ ShiftInZero,
/* u6 */ SrcRow)
Binary Encodings (2)
| Width | Format | Bit Pattern | Mask / Match |
|---|---|---|---|
| 32 | Tensix-32b | 00011000xxxxxxxxxxxxxxxxxxxxxxxx | 0xff000000 / 0x18000000 |
| 32 | Tensix-32b (Blackhole) | 00011000xxxxxxxxxxxxxxxxxxxxxxxx | 0xff000000 / 0x18000000 |
Reference Notes
# `SHIFTXB` (Shift or rotate one row of `SrcB` left by one lane)
**Summary:** One row of `SrcB` is either rotated left by one lane, or shifted left by one lane and the rightmost lane set to zero.
This instruction is `UnsupportedFunctionality` and its use is strongly discouraged: its only known usage is debug code that dumps `SrcB`.
**Backend execution unit:** [Matrix Unit (FPU)](MatrixUnit.md)
## Syntax
```c
TT_SHIFTXB(/* u2 */ AddrMod,
/* bool */ ShiftInZero,
/* u6 */ SrcRow)
```
## Encoding

On Blackhole, `AddrMod` is a `u3` rather than a `u2`, giving this encoding:

## Cross-lane data movement pattern
When `ShiftInZero==false`:

When `ShiftInZero==true`:

## Functional model
This instruction will, if necessary, spend time waiting at the Wait Gate before being dispatched to the Matrix Unit (FPU):
```c
while (SrcB[MatrixUnit.SrcBBank].AllowedClient != MatrixUnit) {
wait;
}
```
Once dispatched to the Matrix Unit (FPU):
```c
UnsupportedFunctionality(); // Only known usage is debug dumps of SrcB
SrcRow = (SrcRow + RWCs[CurrentThread].SrcB) & 0x3f;
uint19_t Column0 = SrcB[MatrixUnit.SrcBBank][SrcRow][0];
for (unsigned Column = 0; Column < 15; ++Column) {
SrcB[MatrixUnit.SrcBBank][SrcRow][Column] = SrcB[MatrixUnit.SrcBBank][SrcRow][Column + 1];
}
SrcB[MatrixUnit.SrcBBank][SrcRow][15] = ShiftInZero ? 0 : Column0;
ApplyAddrMod(AddrMod);
```
## Instruction scheduling
If `SHIFTXB` is used, then on the next cycle, the Matrix Unit (FPU) is not able to accept any instruction. If a thread presents any Matrix Unit (FPU) instruction, then hardware will automatically stall the thread for one cycle.