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

SFPEXEXP

T1 tenstorrent simd insn
SFPEXEXP (Vectorized extract FP32 exponent bits)
SourceTenstorrent Official Tensix ISA Documentation (Wormhole & Blackhole) (tenstorrent_tt_isa)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeBlackholeA0 / WormholeB0
Tenstorrent Wormhole B0 & Blackhole A0
License & VersionApache-2.0
main
Upstreamhttps://github.com/tenstorrent/tt-isa-documentation
Privilegeuser
ExtensionsTensix, Vector Unit, BlackholeA0, WormholeB0

Summary

Performs lanewise extraction of FP32 exponent bits, depositing them as an integer either in the range 0 through 255 or -127 through +128. When the latter range is used, the result is a two's complement integer. Lane flags can also be set based on the sign of the result.

Syntax / Encoding

TT_SFPEXEXP(0, /* u4 */ VC, /* u4 */ VD, /* u4 */ Mod1)

Binary Encodings (1)

WidthFormatBit PatternMask / Match
32Tensix-32b01110111xxxxxxxxxxxxxxxxxxxxxxxx0xff000000 / 0x77000000

Operands

NameDescription
VC
VD
Mod1

Reference Notes

# `SFPEXEXP` (Vectorized extract FP32 exponent bits)

**Summary:** Performs lanewise extraction of FP32 exponent bits, depositing them as an integer either in the range 0 through 255 or -127 through +128. When the latter range is used, the result is a two's complement integer. Lane flags can also be set based on the sign of the result.

**Backend execution unit:** [Vector Unit (SFPU)](VectorUnit.md), simple sub-unit

## Syntax

```c
TT_SFPEXEXP(0, /* u4 */ VC, /* u4 */ VD, /* u4 */ Mod1)
```

## Encoding

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

## Functional model

```c
if (Mod1 & 4) { // Reserved instruction modifier
  NonContractualBehavior {
    Mod1 &= ~4; // Current silicon behavior (not architecturally guaranteed)
  }
}
int32_t Bias = Mod1 & SFPEXEXP_MOD1_NODEBIAS ? 0 : 127;
if (VD < 8 || VD == 16) {
  lanewise {
    if (LaneEnabled) {
      uint32_t c = LReg[VC].u32; // FP32.
      int32_t Exp = (c >> 23) & 0xff;
      LReg[VD].i32 = Exp - Bias; // Two's complement integer.
      if (VD < 8) {
        if (Mod1 & SFPEXEXP_MOD1_SET_CC_SGN_EXP) {
          LaneFlags = LReg[VD].i32 < 0;
        }
        if (Mod1 & SFPEXEXP_MOD1_SET_CC_COMP_EXP) {
          LaneFlags = !LaneFlags;
        }
      }
    }
  }
}
```

Supporting definitions:
```c
#define SFPEXEXP_MOD1_NODEBIAS        1
#define SFPEXEXP_MOD1_SET_CC_SGN_EXP  2
#define SFPEXEXP_MOD1_SET_CC_COMP_EXP 8
```