Decode-Side:JF / PF
本页中的每个偏移、值和地址都从
libtpu-0.0.40-cp314wheel 中的libtpu.so按字节精确读取(libtpu-0.0.40-cp314-cp314-manylinux_2_31_x86_64/libtpu/libtpu.so,BuildID md589edbbe81c5b328a958fe628a9f2207d,未 strip,包含完整 C++ 符号;.text和.rodata按 1:1 映射,VA == 文件偏移)。其他 wheel 版本会有所不同。
摘要
本页记录两个最早 TensorCore MXU encoder 的反汇编逆过程:Jellyfish(TPU v2)VectorExtended slot 和 Pufferfish(TPU v4)双 MXU slot。Jellyfish 41B Bundle 和 Pufferfish 51B Bundle 页面映射 VectorExtendedInstruction proto 如何被打包到 wire bundle 中,而本页映射 wire bundle 如何被解析回该 proto,即 TPU program disassembler、bundle validator 或 round-trip golden test 会走的路径。decode side 是 encode side 的独立确认:decoder 读取 bit N 来恢复 encoder 写入 bit N 的字段,这证明两种读法都是正确的。
两个世代使用两种结构不同的机制进行 decode,这个分裂是本页的核心事实。Jellyfish 把 MXU op 打包到绝对 bits 29..34 上一个连续的 6-bit VectorExtendedOpcode 字段中,因此它的 decoder(DecoderJf::DecodeVectorExtendedSlot @ 0x1e854000)是两级嵌套分派:高三位(32..34)选择 opcode family,低三位(29..31)选择其中的 sub-opcode,把 6-bit 值映射到 VectorExtendedOpcode 枚举并写入 proto。Pufferfish 放弃了连续 opcode 模型:它的 MXU op 通过线性 Opcode::Matches 扫描识别;decoder(TensorCoreVectorExtended0Decoder::Decode @ 0x1ed76f20)先把 bundle 字节暂存到 scratch struct 中,然后按固定顺序尝试每个逐 opcode predicate(Noop、MatrixMultiply…、PushGains…、Transpose…),直到某个匹配。这个 Matches-sweep 形态是 v4 中 codec 设计的起点,并贯穿所有后续世代;VF / GXC decode-side 页面记录其 v5–TPU7x 后代。
最接近的 LLVM 类比是 switch-on-opcode disassembler(Jellyfish:提取 opcode 字段并跳转)与 MatcherTable 风格 predicate cascade(Pufferfish:按优先级测试每种 pattern 的 mask/value 对)之间的差异。TPU 的特殊之处在于 Pufferfish predicate cascade 是按 opcode 生成的;不存在可供 switch 的单一 opcode 字段,因为 matmul、push-gains 和 transpose 占用彼此重叠且宽度不同的 bit window,只有逐 op mask 才能消歧。
对重新实现而言,契约是:
- Jellyfish 两级 decode:先 predication(slot index 6,abs 35),再 family group(abs 32..34)和 sub-opcode(abs 29..31),随后是
VectorExtendedOpcode重建表和 data-source 恢复。 VectorExtendedOpcodeclassifier 范围(IsMatrixMultiply、IsPushGains、IsTranspose、IsRpu、VectorExtendedUsesData)限定 opcode 空间,直接读取自反编译 predicate。- Pufferfish staged-copy +
Opcode::Matches扫描:min(len,13)字节暂存、predication-first 读取,以及 MXU0(abs 89..102)和 −20 MXU1 twin 的逐 opcode mask/value predicate。 - encode/decode bit-position 一致性:每个 decode 位置都确认对应 bundle 页面上 encoder 的
BitCopy/ shift 常量。
| JF decoder 入口 | DecoderJf::DecodeVectorExtendedSlot @ 0x1e854000 |
| JF 分派 | 嵌套 switch:family (qword0>>32)&7(abs 32..34)→ sub-opcode (qword0>>29)&7(abs 29..31) |
| JF opcode sink | VectorExtendedInstruction proto +0x60([VEinst+0x60]),has-bit [VEinst+0x10] |= 0x20 |
| JF data-source | SetVectorRegisterForData @ 0x1e854c40 — vex_source = (qword0>>27)&3(abs 27..28) |
| JF latch sub-table | asc_B833FA0 = {7,8,9,0,10,11,12}(以 (abs29..31)−1 索引) |
| PF decoder 入口 | TensorCoreVectorExtended0Decoder::Decode @ 0x1ed76f20(MXU0),…Extended1Decoder::Decode @ 0x1edcea40(MXU1) |
| PF stage | memcpy(stage+8, span, min(len,13));stage[0]=1 size-tag;在 stage+0x10 处读取 = abs bit 64.. |
| PF MXU0 opcode | matmul abs 89..97(w9);PushGains / Transpose abs 91..97(w7);predication abs 98..102(w5) |
| PF MXU1 twin | 正好 −20(matmul 69..77,opcode 71..77,predication 78..82) |
| 置信度 | CONFIRMED(以字节锚定),除非某行另有说明 |
Jellyfish (v2) — 两级 Jump-Table Decode
目的
DecoderJf::DecodeVectorExtendedSlot 反转 EncoderJf::EncodeVectorExtendedInstruction(0x1e869f00,Jellyfish bundle)。它读取 41 字节 HardwareBundle bit-view,在 Bundle 的 arena 中重建一个 VectorExtendedInstruction proto submessage,并在 VectorProgramErrors accumulator 中记录任何 malformed-opcode 条件。它是 DecoderJf::DecodeBundle(0x1e837e00)为每个已填充 slot 驱动的逐 slot decoder 之一。
入口点
DecoderJf::DecodeBundle @0x1e837e00 ── per-slot decode dispatch (41-byte bundle)
└─ DecodeVectorExtendedSlot @0x1e854000 ── the MXU / VectorExtended slot
├─ DecodePredication(this, bundle, 6, …) ── slot index 6 → predicate @ abs 35
├─ (nested switch on the 6-bit opcode field)
├─ SetVectorRegisterForData @0x1e854c40 ── vex_source + data vreg (abs 27..28)
└─ SetRotateCountForVectorExtended @0x1e854e00 ── RPU rotate operand (families 3,4)
```text
### 算法
decoder 将 bundle qword 0(abs 0..63)读入 `rcx`,把 6-bit opcode 拆成 3-bit family(abs 32..34)和 3-bit sub-opcode(abs 29..31),并把重建出的 `VectorExtendedOpcode` 写入 proto。其结构是对 family 的 `switch`,每个 family 内有嵌套 `switch`/table,这是编译器对两级 decode 的实现。
```c
// DecoderJf::DecodeVectorExtendedSlot @ 0x1e854000 (decompiled, verified)
function DecodeVectorExtendedSlot(this, bundle, out_bundle, errors):
if (!DecodePredication(this, bundle, /*slot=*/6, out_bundle)) // predicate @ abs 35
return Ok // slot is a nop
out_bundle[0x10] |= 0x80 // mark VE slot present
ve = arena.DefaultConstruct<VectorExtendedInstruction>() // proto +0x50 of out_bundle
CHECK(bundle.encoding().size() == 41) // decoder_jf.cc:721
qword0 = bundle.qword[0] // abs 0..63
family = (qword0 >> 32) & 7 // abs 32..34 (top 3 opcode bits)
sub = (uint32)qword0 >> 29 // abs 29..31 (low 3 opcode bits)
switch (family):
case 0: // matmul group
switch (sub): // sub 0 = invalid
1..7: veopcode = sub - 1 // → {0,1,2,3,4,5,6}
0: errors.set_bad_vector_op_code(1); return Error
ve[0x60] = veopcode; ve[0x10] |= 0x20 // write opcode + has-bit
if (VectorExtendedUsesData(veopcode)) // op != 3
SetVectorRegisterForData(qword_ptr, ve, errors)
case 1: // latch / PushGains group
i = sub - 1
if (((0x77 >> i) & (i < 7)) == 0) { errors.set_…; return Error } // valid i={0,1,2,4,5,6} → sub={1,2,3,5,6,7}
ve[0x60] = asc_B833FA0[i] // {7,8,9,0,10,11,12}[i]
ve[0x10] |= 0x20; SetVectorRegisterForData(…)
// families 2,5,6,7 guard sub<=4 (qword0 >= 0xA0000000 → sub>=5 is invalid-opcode error)
case 2: if (sub>=5) error; ve[0x60] = sub + 13; …; SetVectorRegisterForData(…) // {13..17}
case 3: ve[0x60] = 18; …; SetRotateCountForVectorExtended(…); SetVectorRegisterForData(…)
case 4: ve[0x60] = 19; …; SetRotateCountForVectorExtended(…); SetVectorRegisterForData(…)
case 5: if (sub>=5) error; ve[0x60] = sub + 20; …; SetVectorRegisterForData(…) // {20..24}
case 6: if (sub>=5) error; ve[0x60] = sub + 25; …; SetVectorRegisterForData(…) // {25..29}
case 7: if (sub>=5) error; ve[0x60] = sub + 30; …; SetVectorRegisterForData(…) // {30..34}
return Okopcode 字段与 encoder 使用 mask 0xFFFFFFF81FFFFFFF 清除的 6-bit window(bits 29..34)相同;decoder 读取 (qword0>>32)&7 得到 family,并读取 (uint32)qword0>>29 得到 sub-opcode,二者合起来精确重建该字段。由于 encoder scratch 的 struct byte 0x0C 是绝对 bit 96(12-byte-strip law),encoder 的 qword-0 shift 常量可逐字视为其绝对 bit 位置,decoder 的 shift 与它们一一匹配。这把 JF opcode / data-source / predicate 字段提升为 CERTAIN 级交叉确认。
怪异点 — sub-opcode 从一开始偏移,而不是从零开始。 对 family 0,decoder 把 sub-opcode
1..7映射到VectorExtendedOpcode 0..6,而 sub-opcode0是 invalid-opcode 错误,不是 opcode 0。latch family(1)也一样:它用sub−1索引asc_B833FA0。把 sub-opcode 当作直接 opcode 索引的重新实现会在每个 family-0/1 op 上偏移一位,并会静默接受保留的 sub-opcode 0。sub-field 中的 on-wire 值 0 是 encoder 保留全零 slot 的方式。注意 — families 3 和 4 在 proto opcode 中不携带 sub-opcode(它们 decode 为固定值 18 和 19),但它们确实通过
SetRotateCountForVectorExtended(0x1e854e00)读取 rotate operand;这些是 RPU rotate/permute op,其 shift count 是一个独立 operand,而不是 opcode 的一部分。Families 2、5、6、7 组成剩余的{13..34}transpose/RPU 范围(每个都保护sub<=4),并且只读取 data-source vreg。
VectorExtendedOpcode Classifier 范围
6-bit VectorExtendedOpcode 空间由五个 ProtoUtils predicate 划分,每个都是直接从反编译读取的小型算术测试。这些是权威范围;它们是二进制中的常量,不是推断:
// platforms_deepsea::jellyfish::isa::ProtoUtils (verified)
IsMatrixMultiply(op): return (op < 7) & (0x77 >> op); // {0,1,2,4,5,6} @ 0x1e875b20
IsPushGains(op): return (uint)(op - 7) < 6; // {7..12} @ 0x1e875b80
IsTranspose(op): return (uint)(op - 15) < 2; // {15,16} @ 0x1e875b40
IsRpu(op): return (uint)(op - 17) < 0x12; // {17..34} @ 0x1e875b60
VectorExtendedUsesData(op): return op != 3; // op 3 reads no data @ 0x1e876160
```text
| VEopcode 范围 | Classifier | 家族 |
|---|---|---|
| `0,1,2,4,5,6` | `IsMatrixMultiply`(`op<7 & 0x77>>op`) | dense matmul step |
| `3` | 从 `IsMatrixMultiply` 排除;`!VectorExtendedUsesData` | staging-only matmul(不读取 vector data operand) |
| `7..12` | `IsPushGains` | weight-latch(`GainLatchMode 0..5` 范围) |
| `15,16` | `IsTranspose` | matrix transpose(matprep) |
| `17..34` | `IsRpu` | reduce / permute-unit 家族 |
> **陷阱 —** `IsTranspose` 是反编译 predicate(`0x1e875b40`)`(op − 15) < 2`,即 opcodes **`{15,16}`**;transpose 对位于 `IsRpu` 范围(`{17..34}`)*下方*,不在其中。把 transpose op 分类到 17/18 的重新实现会把两个 RPU op 错标为 transpose,并漏掉真正的 transpose 对。同样,`IsMatrixMultiply` 是 `(op<7) & (0x77>>op)`,它**排除 opcode 3**(`0x77 = 0b1110111` 的 bit 3 为清);opcode 3 是由 `VectorExtendedUsesData(op)==false` 标记的 staging-only matmul。
### Data-Source 恢复
`SetVectorRegisterForData`(`0x1e854c40`)读取 abs 27..28 处的 2-bit `vex_source` selector,并根据其值从*不同* bit window 恢复 data vreg;source kind 决定寄存器编号所在位置:
```c
// SetVectorRegisterForData @ 0x1e854c40 (decompiled, verified)
function SetVectorRegisterForData(qword_ptr, ve, errors):
switch ((qword0 >> 27) & 3): // vex_source @ abs 27..28
case 0: ve[0x64] = 0; reg = (word@14 | byte@16<<16) >> 14 & 0x1F // vs0-relative
case 1: ve[0x64] = 1; reg = (dword@10 >> 15) & 0x1F // vs1-relative
case 2: ve[0x64] = 2; reg = (word@8 >> 11) // vs2-relative
case 3: errors.set_bad_vex_source(1); return Error // "Bad vex_source value: 3"
ve[0x6c] = reg; append reg to ve.repeated_field; ve[0x10] |= 0x141怪异点 — abs 27..28 是 data-source selector,而不是物理 MXU id。 encoder 从 proto
+0x64写入这个 2-bit 字段(Jellyfish bundle 页面把它标为 "mxu-id"),但 decoder 将它命名为vex_source,并用它选择 systolic-feed register 相对哪个 vector-source port(vs0/vs1/vs2)读取;值 3 是 invalid-source 错误。在普通 Jellyfish 上只有一个 MXU(MatrixStagingRegisterCount@0x1d490340返回 1),因此该字段的“哪个 MXU”读法会塌缩;在 Dragonfish(v3)上它是有效的。寄存器编号本身会根据 source 值从不同 bit window 读取,因此 decoder 必须先 decode 这个 2-bit selector,才能恢复 data vreg。encode-side 视角参见 MXU Slot。
Pufferfish (v4) — Staged-Copy / Opcode::Matches 扫描
目的
Pufferfish 的 MXU op 不是单个 opcode 字段,因此其 decoder 不能 switch。相反,TensorCoreVectorExtended0Decoder::Decode(0x1ed76f20,MXU0)和 …Extended1Decoder::Decode(0x1edcea40,MXU1)通过依次尝试每个逐 opcode Opcode::Matches predicate 来重建 TensorCoreVectorExtended0/1 proto。每个 predicate 都是对暂存 bundle bit 的 mask/value 测试;第一个匹配项命名 op 并选择其 operand-field accessor。这是 BitCopy 打包的 Pufferfish slot(Pufferfish bundle)按字节精确的逆过程。
入口点
TensorCoreCodecBase<…>::Decode @0x1d223240 ── 12-slot decode dispatch
├─ TensorCoreVectorExtended0Decoder::Decode @0x1ed76f20 ── MXU0 (abs 83..102)
│ ├─ TensorCoreVectorExtended0PredicationField::GetConcatenatedValue (read FIRST)
│ ├─ TensorCoreVectorExtended0NoopOpcode::Matches @0x1eda6400
│ ├─ …MatrixMultiply{Rounded,Low,Hi,…}{Mxu0..3}Opcode::Matches @0x1eda6420..
│ ├─ …PushGains{Rounded,Low,Hi,Byte}[Masked]Opcode::Matches @0x1eda7060..
│ └─ …{DoneWithGains,Transpose,PackedTranspose,…}Opcode::Matches
└─ TensorCoreVectorExtended1Decoder::Decode @0x1edcea40 ── MXU1 (abs 63..82, the −20 twin)
```text
### 算法
decoder 在 bundle arena 中默认构造 proto,把最多 13 个 bundle 字节暂存到 scratch struct 中,先读取 predication 字段(并约束其 `< 0x20`),然后扫描 `Opcode::Matches` predicate。staged struct layout 是 V4+ 反复出现的形态:offset 0 处是 size-tag,bundle 字节位于 offset 8,因此读取 scratch quadword offset `0x10` 的 predicate 实际读取绝对 bundle bits `(0x10−8)*8 = 64` 及之后。
```c
// TensorCoreVectorExtended0Decoder::Decode @ 0x1ed76f20 (decompiled, verified)
function Decode(span):
ve = arena.DefaultConstruct<TensorCoreVectorExtended0>()
stage[0] = 1 // size-tag
n = min(span.len, 13) // 13-byte stage covers abs 63..102
memcpy(stage + 8, span.data, n) // bundle bytes at stage+8 (abs 0..)
pred = TensorCoreVectorExtended0PredicationField::GetConcatenatedValue(stage)
if (pred >= 0x20) return Error("… does not match any encodings")
ve.predication = pred
// linear Opcode::Matches sweep — first match wins
if (NoopOpcode::Matches(stage)) { ve.opcode = Noop; return Ok }
if (MatrixMultiplyRoundedMxu0::Matches(s)) { ve.opcode = …Mxu0; return Ok }
… // 154 Extended0 predicates total
if (PushGainsRoundedOpcode::Matches(s)) { ve.opcode = PushGains…; return Ok }
…注意 — staged-copy-then-
Matches形态从 v4 到 TPU7x 都一致;只有 mask 中的 abs bit 位置会按世代平移。VF / GXC decode-side 页面记录 Viperfish、Ghostlite 和6acc60406家族中相同的GetConcatenatedValue+Opcode::Matches机制,在那里它是唯一的 decode 路径。Pufferfish 是 v4 起点。
MXU0 Opcode Predicate — Mask/Value 表
每个 Opcode::Matches 都读取 offset 0x10 处的 staged quadword(abs 64..127),与 mask 做 AND,再与 value 比较。mask 固定字段宽度和基址;value 是 opcode。以下逐字节读取自 predicate 函数体:
| Opcode::Matches | Mask(staged qword @ +0x10) | 绝对 bits | 值 | 含义 |
|---|---|---|---|---|
NoopOpcode (0x1eda6400) | ~val & 0x7C00000000 == 0 | 98..102 | 全 1 | predicate == 31(kNeverExecute) |
MatrixMultiplyRoundedMxu0 (0x1eda6420) | (word@+19) & 0x3FE == 0 | 89..97(w9) | mxu-num 0 | op-hi 0,mxu-num @ 89..90 = 0 |
MatrixMultiplyRoundedMxu1 (0x1eda6440) | & 0x3FE000000 == 0x2000000 | 89..97 | mxu-num 1 | bit 89 置位 |
PushGainsRounded (0x1eda7060) | & 0x3F8000000 == 0x100000000 | 91..97(w7) | 0x20 | weight-latch rounded |
PushGainsLow (0x1eda7080) | & 0x3F8000000 == 0x108000000 | 91..97 | 0x21 | latch .low |
PushGainsByte (0x1eda70e0) | & 0x3F8000000 == 0x120000000 | 91..97 | 0x24 | latch .byte |
DoneWithGainsGsfn (0x1eda7020) | & 0x3F8000000 == 0xC0000000 | 91..97 | 0x18 | end-of-gains (gsfn) |
Transpose (0x1eda7360) | & 0x3F8000000 == 0x200000000 | 91..97 | 0x40 | systolic transpose op |
这两个字段基址直接来自 mask:0x3FE000000 是 staged qword 的 bits 25..33(= abs 89..97,9-bit matmul opcode),而 0x3F8000000 是 bits 27..33(= abs 91..97,7-bit non-matmul opcode)。把每个比较值按其基址右移即可恢复 opcode:0x100000000 >> 27 = 0x20(PushGainsRounded),0x120000000 >> 27 = 0x24(PushGainsByte),0xC0000000 >> 27 = 0x18(DoneWithGainsGsfn),0x200000000 >> 27 = 0x40(Transpose)。这从 decode side 逐字节独立确认了 Pufferfish bundle 的 MXU0 layout(opcode @ 91 w7,matmul @ 89 w9,predicate @ 98 w5)以及 MXU Slot 中的 PushGains opcode = 0x20 + variant + masked·0x10 公式。
陷阱 — Noop 是 predicate 全 1,不是 predicate 为零。
NoopOpcode::Matches是(~val & 0x7C00000000) == 0,即 bits 98..102 全部置位时匹配;5-bit predicate 等于 31(kNeverExecute),即 empty-slot stamp。早先读法曾把 Noop 描述为“bits 98..102 为零”。通过测试 predicate 字段为零来检测空 MXU slot 的重新实现,会把一个有效的 predicate-register-0 op 错分为 nop,并漏掉真正的kNeverExecuteempty marker。空 slot 是最大 5-bit 值,这与kNeverExecuteprefill 一致。怪异点 — matmul opcode 加宽以吸收物理 MXU 编号。 non-matmul opcode 是 abs 91..97 处的 7-bit 字段(mask
0x3F8000000);matmul opcode 是 abs 89..97 处的 9-bit 字段(mask0x3FE000000),其低两位 @ 89..90 携带物理 MXU 编号 0..3(Mxu0mask 要求 bits 89..90 清零;Mxu1要求 bit 89 置位)。因此matmul opcode = (op-hi << 2) | mxu-num,四个物理 array(mxu_count = 4)是在 opcode 内部选择,而不是由 bundle slot 选择。把 matmul opcode mask 成 7 bit 的 decoder 会丢失 MXU-num,并把每个 matmul decode 为Mxu0。参见 MXU Slot。
MXU1 — −20-Bit Twin
TensorCoreVectorExtended1Decoder::Decode(0x1edcea40)是同样的扫描,但 control 区域精确下移 20 bit。MXU1 predicate 读取 offset 0x10 处的 staged dword(低 32 bit 覆盖 abs 64..95),而不是 qword;它们的 mask 是 MXU0 mask 下移 20 位:
| Opcode::Matches | Mask(staged dword @ +0x10) | 绝对 bits | 值 |
|---|---|---|---|
Extended1MatrixMultiplyLowMxu0 (0x1edfdd00) | & 0x3FE0 == 128 | 69..77(w9) | bit 71 置位 |
Extended1PushGainsRounded (0x1edfe8c0) | & 0x3F80 == 4096 | 71..77(w7) | 0x20 |
Extended1Noop (0x1edfdc60) | ~val & 0x7C000 == 0 | 78..82 | 全 1(31) |
算术精确确认 −20 偏移:0x3FE0 是 staged dword 的 bits 5..13(= abs 69..77,即 9-bit matmul opcode 89..97 减 20);0x3F80 是 bits 7..13(= abs 71..77,即 7-bit opcode 91..97 减 20);4096 = 0x1000,且 0x1000 >> 7 = 0x20,与 MXU0 的 PushGainsRounded 值相同。Noop mask 0x7C000 是 bits 14..18(= abs 78..82,即 predicate 98..102 减 20)。
| 字段 | MXU0 abs | MXU1 abs | Δ |
|---|---|---|---|
| matmul opcode | 89..97 | 69..77 | −20 |
| non-matmul opcode | 91..97 | 71..77 | −20 |
| predication | 98..102 | 78..82 | −20 |
怪异点 — 两个 MXU control slot,四个物理 MXU。 Pufferfish 有两个
VectorExtendedcontrol slot(MXU0/MXU1,即 −20 twin)和四个物理 array。slot 选择 control lane;matmul opcode 的低两位选择 array。这里的 −20 twin 是同一双 MXU 几何形态在 v4 的起点,它在 Viperfish 上仍为 −20,在 Ghostlite 上为 −21,在6acc60406家族上为 −25;参见 VF / GXC decode-side 和 MXU Slot 的跨世代汇总。
按世代 Decode 机制汇总
五个世代的 decode 参考包括本页(JF、PF)及其 VF / GXC 配套页面:
| Gen | 代号 | Bundle | Decode 机制 | MXU opcode 字段 | Twin |
|---|---|---|---|---|---|
| v2 | jellyfish | 41 B | 对 6-bit opcode 的两级嵌套 switch(family abs 32..34 + sub abs 29..31) | abs 29..34(单 VE slot) | n/a |
| v4 | pufferfish | 51 B | staged copy + 线性 Opcode::Matches 扫描 | MXU0 abs 89/91;MXU1 abs 69/71 | −20 |
| v5 | viperfish | 64 B | staged copy + Opcode::Matches 扫描 | MXU0 push@59 mm@57 | −20 |
| v6e | ghostlite | 64 B | staged copy + Opcode::Matches 扫描 | MXU0 unified op@58(w8) | −21 |
| TPU7x | 6acc60406 | 64 B | staged copy + Opcode::Matches 扫描 | MXU0 unified op@62(w8) | −25 |
Jellyfish 是唯一只有一个 VE issue slot(没有 twin)且使用 jump-table 风格 opcode decode 的世代,因为它的 opcode 是一个连续的 6-bit 字段。Pufferfish 及之后的每个世代都使用 staged-copy + Opcode::Matches codec;Pufferfish 是 codec 设计和 −N 双 MXU twin 的 v4 起点。
相关组件
| 组件 | 关系 |
|---|---|
DecoderJf::DecodeVectorExtendedSlot 0x1e854000 | JF MXU slot decoder(两级 opcode decode) |
SetVectorRegisterForData 0x1e854c40 | JF data-source / vreg 恢复(vex_source abs 27..28) |
ProtoUtils::Is{MatrixMultiply,PushGains,Transpose,Rpu} 0x1e875b20..b60 | JF VectorExtendedOpcode classifier |
TensorCoreVectorExtended0Decoder::Decode 0x1ed76f20 | PF MXU0 decoder(staged copy + Opcode::Matches) |
TensorCoreVectorExtended1Decoder::Decode 0x1edcea40 | PF MXU1 decoder(−20 twin) |
EncoderJf::EncodeVectorExtendedInstruction 0x1e869f00 | 本页反转的 JF encode side |
交叉引用
- Bundle Model — VLIW bundle、slot dispatch,以及 MXU slot 所在的
kNeverExecute约定。 - Jellyfish 41B Bundle — v2
VectorExtendedencode side;使 JF shift 常量等于其绝对 bit 的 12-byte-strip law。 - Pufferfish 51B Bundle — 本页 decode 逐字节确认的 v4 双 MXU
BitCopy打包 slot 映射。 - Decode-Side: VF / GXC — v5–TPU7x 对应页:相同的 staged-copy +
Opcode::Matchescodec,−20/−21/−25 twin,以及 abs57/58 Transpose/Target 字段。 - MXU Slot — 本页 decode 的跨世代 MXU op 家族、opcode 名册,以及 matmul/PushGains/transpose 语义。