ADDRCRZW
tenstorrent_tt_isa)Tenstorrent Wormhole B0 & Blackhole A0
main
userTensix, Miscellaneous Unit, WormholeB0Summary
Backend execution unit: Miscellaneous Unit
Syntax / Encoding
TT_ADDRCRZW(((/* bool */ PK) << 2) +
((/* bool */ U1) << 1) +
/* bool */ U0,
/* u3 */ W1Inc,
/* u3 */ Z1Inc,
/* u3 */ W0Inc,
/* u3 */ Z0Inc,
((/* bool */ W1) << 3) +
((/* bool */ Z1) << 2) +
((/* bool */ W0) << 1) +
/* bool */ Z0)
Binary Encodings (1)
| Width | Format | Bit Pattern | Mask / Match |
|---|---|---|---|
| 32 | Tensix-32b | 01010110xxxxxxxxxxxxxxxxxxxxxxxx | 0xff000000 / 0x56000000 |
Reference Notes
# `ADDRCRZW` (Manipulate some ADC Z and W counters)
**Summary:**
**Backend execution unit:** [Miscellaneous Unit](MiscellaneousUnit.md)
## Syntax
```c
TT_ADDRCRZW(((/* bool */ PK) << 2) +
((/* bool */ U1) << 1) +
/* bool */ U0,
/* u3 */ W1Inc,
/* u3 */ Z1Inc,
/* u3 */ W0Inc,
/* u3 */ Z0Inc,
((/* bool */ W1) << 3) +
((/* bool */ Z1) << 2) +
((/* bool */ W0) << 1) +
/* bool */ Z0)
```
There is no syntax to specify `/* u2 */ ThreadOverride`; if a non-zero value is desired for this field, the raw encoding must be used. Use of `ThreadOverride` is `UnsupportedFunctionality` and is strongly discouraged. In practice, on both Wormhole and Blackhole, a non-zero `ThreadOverride` applies the instruction to the counters of thread `ThreadOverride - 1` instead of the issuing thread's, as the functional model below describes. An override can corrupt the named thread's ADCs if that thread, or another override, reaches them in the same cycle; see [overriding another thread's ADCs](ADCs.md#overriding-another-threads-adcs).
## Encoding

## Functional model
```c
if (ThreadOverride) {
UnsupportedFunctionality(); // Wormhole and Blackhole hardware behave as below
}
uint2_t WhichThread = ThreadOverride == 0 ? CurrentThread : ThreadOverride - 1;
if (U0) ApplyTo(ADCs[WhichThread].Unpacker[0]);
if (U1) ApplyTo(ADCs[WhichThread].Unpacker[1]);
if (PK) ApplyTo(ADCs[WhichThread].Packers);
void ApplyTo(ADC& ADC_) {
if (Z0) ADC_.Channel[0].Z_Cr += Z0Inc, ADC_.Channel[0].Z = ADC_.Channel[0].Z_Cr;
if (W0) ADC_.Channel[0].W_Cr += W0Inc, ADC_.Channel[0].W = ADC_.Channel[0].W_Cr;
if (Z1) ADC_.Channel[1].Z_Cr += Z1Inc, ADC_.Channel[1].Z = ADC_.Channel[1].Z_Cr;
if (W1) ADC_.Channel[1].W_Cr += W1Inc, ADC_.Channel[1].W = ADC_.Channel[1].W_Cr;
}
```