Engineering Category: Lossless Wire & Structural Compression
Best Use in Production: Zero-allocation integer bit-packing, variable-length encoding, and stream framing for sovereign wire protocols.
When to Select This Capsule: Sole canonical implementation for its 64-vector functional equivalence class. Sub-10-cycle hardware kernel (1353957/200000 cyc/op); safe for ultra-hot per-sample or per-packet inner loops.
Snap-Circuit Wiring Role: Specialized Multi-Pin Stage `(u8,u8,u16)->u32` — wire matching input pins via `snap_dag` or `snap_pipeline`.
.text: 29 B (9 x86_64 insns)195 B)pub const fn encode_add_imm(rd: u8, rn: u8, imm12: u16) -> u32 {
0x9100_0000
| (((imm12 & 0x0FFF) as u32) << 10)
| (((rn & 0x1F) as u32) << 5)
| ((rd & 0x1F) as u32)
}
rustc -C opt-level=3 x86_64 Disassembly (29 B .text / 9 insns)encode_add_imm:
and edx, 4095
shl edx, 10
and esi, 31
shl esi, 5
or esi, edx
and edi, 31
lea eax, [rdi + rsi]
add eax, -1862270976
ret
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #551 | encode_add_imm (THIS CAPSULE) domain: smart-tree | id: c1e1836fd7f4708deca70abb734345c9 | 1353957/200000 cyc/op | 1289699/400000 ns/op | 400000000/1289699 ops/us | 29 B .text (9 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |