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

SFPMULI

T1 tenstorrent fp insn
SFPMULI (Vectorized floating-point multiply using BF16 immediate)
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
Note: If SFPMULI is used, software must ensure that on the next cycle, the Vector Unit (SFPU) does not execute an instruction which reads from any location written to by the SFPMULI. An SFPNOP instruction can be inserted to ensure this.

Summary

Performs lanewise FP32 VD *= BF16ToFP32(Imm16).

Syntax / Encoding

TT_SFPMULI(/* u16 */ Imm16, /* u4 */ VD, /* u4 */ Mod1)

Binary Encodings (1)

WidthFormatBit PatternMask / Match
32Tensix-32b01110100xxxxxxxxxxxxxxxxxxxxxxxx0xff000000 / 0x74000000

Operands

NameDescription
Imm16
VD
Mod1

Reference Notes

# `SFPMULI` (Vectorized floating-point multiply using BF16 immediate)

**Summary:** Performs lanewise FP32 `VD *= BF16ToFP32(Imm16)`.

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

## Syntax

```c
TT_SFPMULI(/* u16 */ Imm16, /* u4 */ VD, /* u4 */ Mod1)
```

## Encoding

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

## Functional model

```c
if (Mod1 & 7) { // Reserved instruction modifiers
  NonContractualBehavior {
    Mod1 &= ~7; // Current silicon behavior (not architecturally guaranteed)
  }
}
unsigned VC = VD;
lanewise {
  if (VD < 12 || LaneConfig[Lane].DISABLE_BACKDOOR_LOAD) {
    if (LaneEnabled) {
      float c = LReg[VC].f32;
      float d = BF16ToFP32(Imm16) * c + 0.0;
      unsigned vd;
      if ((Mod1 & SFPMAD_MOD1_INDIRECT_VD) && VD != 16) {
        vd = LReg[7].u32 & 15;
      } else {
        vd = VD;
      }
      if (vd < 8 || vd == 16) {
        LReg[vd].f32 = d;
      }
    }
  }
}
```

Supporting definitions:

```c
#define SFPMAD_MOD1_INDIRECT_VD 8

float BF16ToFP32(uint16_t x) {
  return std::bit_cast<float>(uint32_t(x) << 16);
}
```

## IEEE754 conformance / divergence

As per [`SFPMAD`](SFPMAD.md#ieee754-conformance--divergence).

## Instruction scheduling

If `SFPMULI` is used, software must ensure that on the next cycle, the Vector Unit (SFPU) does not execute an instruction which reads from any location written to by the `SFPMULI`. An [`SFPNOP`](SFPNOP.md) instruction can be inserted to ensure this.