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

REG2FLOP_ADC

T1 tenstorrent alu insn
REG2FLOP (Move from GPRs to ADCs)
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: This instruction usually takes two cycles, though it will take longer if Configuration Unit instructions (from any Tensix thread or any baby RISCV) are writing to THCON configuration. This is not a typo; it applies _even though_ this variant of REG2FLOP does not touch THCON configuration. The instruction occupies the…

Summary

Move between 8 and 32 bits of a GPR to an ADC value, where it can subsequently be used for unpacker or packer address computations. To instead move a constant to an ADC value, see SETADC or SETADCXX or SETADCXY or SETADCZW. This instruction is UnsupportedFunctionality and its use is discouraged.

Syntax / Encoding

TT_REG2FLOP(/* u2 */ SizeSel,
            2 + /* bool */ OverrideThread,
            /* u2 */ Shift8,
            /* u2 */ ThreadSel,
          ((/* u1 */ Channel) << 5) +
          ((/* u2 */ ADCSel) << 3) +
          ((/* bool */ Cr) << 2) +
            /* u2 */ XYZW,
            /* u6 */ InputReg)

Binary Encodings (1)

WidthFormatBit PatternMask / Match
32Tensix-32b01001000xx1xxxxxxxxxxxxxxxxxxxxx0xff200000 / 0x48200000

Reference Notes

# `REG2FLOP` (Move from GPRs to ADCs)

**Summary:** Move between 8 and 32 bits of a GPR to an ADC value, where it can subsequently be used for unpacker or packer address computations. To instead move a constant to an ADC value, see `SETADC` or `SETADCXX` or `SETADCXY` or `SETADCZW`. This instruction is `UnsupportedFunctionality` and its use is discouraged.

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

## Syntax

```c
TT_REG2FLOP(/* u2 */ SizeSel,
            2 + /* bool */ OverrideThread,
            /* u2 */ Shift8,
            /* u2 */ ThreadSel,
          ((/* u1 */ Channel) << 5) +
          ((/* u2 */ ADCSel) << 3) +
          ((/* bool */ Cr) << 2) +
            /* u2 */ XYZW,
            /* u6 */ InputReg)
```

## Encoding

![](../../../Diagrams/Out/Bits32_REG2FLOP_ADC.svg)

## Functional model

```c
UnsupportedFunctionality(); // No known usage, confidence in specification below is weak
uint32_t Value = GPRs[CurrentThread][InputReg];
switch (SizeSel) {
case 0: // 128 bit (not valid)
  Value = 0;
  break;
case 1: // 32 bit
  if (Shift8 != 0) Value = 0;
  break;
case 2: // 16 bit
  if (Shift8 == 0) Value &= 0xffff;
  else if (Shift8 == 2) Value >>= 16;
  else Value = 0;
  break;
case 3: // 8 bit
  Value = (Value >> (Shift8 * 8)) & 0xff;
  break;
}

uint2_t WhichThread = CurrentThread;
if (OverrideThread) {
  WhichThread = ThreadSel;
  if (WhichThread >= 3) return;
}
ADC* ADC_;
switch (ADCSel) {
case 0: ADC_ = &ADCs[WhichThread].Unpacker[0]; break;
case 1: ADC_ = &ADCs[WhichThread].Unpacker[1]; break;
case 2: ADC_ = &ADCs[WhichThread].Packers; break;
case 3: return;
}
auto& Ch = ADC_->Channel[Channel];

switch (XYZW) {
case 0: Cr ? Ch.X_Cr = Value : Ch.X = Value; break;
case 1: Cr ? Ch.Y_Cr = Value : Ch.Y = Value; break;
case 2: Cr ? Ch.Z_Cr = Value : Ch.Z = Value; break;
case 3: Cr ? Ch.W_Cr = Value : Ch.W = Value; break;
}
```

## Performance

This instruction usually takes two cycles, though it will take longer if [Configuration Unit](ConfigurationUnit.md) instructions (from any Tensix thread or any baby RISCV) are writing to THCON configuration. This is not a typo; it applies _even though_ this variant of `REG2FLOP` does not touch THCON configuration. The instruction occupies the [Scalar Unit (ThCon)](ScalarUnit.md) for the entire duration, and the issuing thread will be blocked from issuing subsequent instructions for the entire duration.