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 (400899/100000 cyc/op); safe for ultra-hot per-sample or per-packet inner loops.
Snap-Circuit Wiring Role: 1-to-1 Unary Transform Stage `(i32)->i32` — snaps directly into linear pipelines or fan-out DAG branches.
.text: 13 B (6 x86_64 insns)137 B)pub fn ec_ilog(value: i32) -> i32 {
if value <= 0 {
0
} else {
32 - (value as u32).leading_zeros() as i32
}
}
rustc -C opt-level=3 x86_64 Disassembly (13 B .text / 6 insns)ec_ilog:
bsr ecx, edi
inc ecx
xor eax, eax
test edi, edi
cmovg eax, ecx
ret
| Global Rank | Capsule & Domain | Hardware _rdtsc | Latency | Throughput | ELF .text | Ternary Vote | Author Aye |
|---|---|---|---|---|---|---|---|
| #47 | ec_ilog (THIS CAPSULE) domain: smart-tree | id: c24cb66f3eb2bc2581897546c3ddb3fb | 400899/100000 cyc/op | 763783/400000 ns/op | 400000000/763783 ops/us | 13 B .text (6 insns) | + (1) | aye::Hue+Gemini(0+1)::x86_64 @ 432Hz |