ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 913 microarchs · 15,555 chips · 105 sources
Arch:
Tier:

SHIFTDMAREG

T1 tenstorrent load_store insn
SHIFTDMAREG (Perform bitwise shift on GPRs)
SourceTenstorrent Official Tensix ISA Documentation (Wormhole & Blackhole) (tenstorrent_tt_isa)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeWormholeB0
Tenstorrent Wormhole B0 & Blackhole A0
License & VersionApache-2.0
main
Upstreamhttps://github.com/tenstorrent/tt-isa-documentation
Privilegeuser
ExtensionsTensix, Scalar Unit, WormholeB0
Note: The RightImm5 variant takes three cycles. The RightReg variant takes three cycles if LeftReg and RightReg come from the same aligned group of four GPRs, or four cycles otherwise.

Summary

Performs an unsigned bitwise shift (left or right) of one Tensix GPR by another, or of one Tensix GPR by a 5-bit immediate.

Syntax / Encoding

TT_SHIFTDMAREG(0, /* u3 */ Mode, /* u6 */ ResultReg, /* u6 */ RightReg , /* u6 */ LeftReg)
TT_SHIFTDMAREG(1, /* u3 */ Mode, /* u6 */ ResultReg, /* u5 */ RightImm5, /* u6 */ LeftReg)

Binary Encodings (2)

WidthFormatBit PatternMask / Match
32Tensix-32b010111000xxxxxxxxxxxxxxxxxxxxxxx0xff800000 / 0x5c000000
32Tensix-32b010111001xxxxxxxxxxxxxxxxxxxxxxx0xff800000 / 0x5c800000

Operands

NameDescription
Mode
ResultReg
RightReg
LeftReg
RightImm5

Reference Notes

# `SHIFTDMAREG` (Perform bitwise shift on GPRs)

**Summary:** Performs an unsigned bitwise shift (left or right) of one Tensix GPR by another, or of one Tensix GPR by a 5-bit immediate.

This instruction is `UnsupportedFunctionality` and its use is strongly discouraged: it has no known usage.

**Backend execution unit:** [Scalar Unit (ThCon)](ScalarUnit.md)

## Syntax

```c
TT_SHIFTDMAREG(0, /* u3 */ Mode, /* u6 */ ResultReg, /* u6 */ RightReg , /* u6 */ LeftReg)
TT_SHIFTDMAREG(1, /* u3 */ Mode, /* u6 */ ResultReg, /* u5 */ RightImm5, /* u6 */ LeftReg)
```

## Encoding

![](../../../Diagrams/Out/Bits32_SHIFTDMAREG.svg)
![](../../../Diagrams/Out/Bits32_SHIFTDMAREGi.svg)

## Functional model

```c
UnsupportedFunctionality(); // No known usage
uint32_t LeftVal = GPRs[CurrentThread][LeftReg];
uint32_t RightVal = GPRs[CurrentThread][RightReg] & 0x1f; // RightReg  variant
uint32_t RightVal = RightImm5;                            // RightImm5 variant
uint32_t ResultVal;
switch (Mode) {
case SHIFTDMAREG_MODE_LEFT:  ResultVal = LeftVal << RightVal; break;
case SHIFTDMAREG_MODE_RIGHT: ResultVal = LeftVal >> RightVal; break;
default: UndefinedBehavior(); break;
}
GPRs[CurrentThread][ResultReg] = ResultVal;
```

Supporting definitions:
```c
#define SHIFTDMAREG_MODE_LEFT  0
#define SHIFTDMAREG_MODE_RIGHT 1
```

## Performance

The `RightImm5` variant takes three cycles. The `RightReg` variant takes three cycles if `LeftReg` and `RightReg` come from the same aligned group of four GPRs, or four cycles otherwise.