30.9.50-51Bitmanip VIII: zext.h, zip & the Family Scorecard

Part III Linux boot: recommended Vol. I (Unprivileged) pp. 277–278 · ~2 min read

The last two reference entries, and the exit summary for the whole chapter.

zext.h and zip
SemanticsEncodingIn
zext.h rd, rsZero-extend the low halfword.funct7 0000100, rs2=00000, funct3 100 — OP (RV32) / OP-32 (RV64)Zbb
zip rd, rs (RV32, detailed with unzip on the previous page)Bit-interleave the two halves of rs.OP-IMM funct12 0000100_01111 / 001Zbkb
Dotted-underlined cells have explanations — click one.

The chapter in one table

What each Zb* extension costs and buys
Hardware costPayoff
Zba3 adder mux legs + zero-extendOne instruction back per array access — the best gates-to-IPC trade in the catalog.
ZbbScan tree, rotator wrap, inverter reuse, wiring permutationsstrlen/bswap/clamp/bitmap idioms; compiler-default output.
ZbsOne-hot decoder into the logic unitFlag and bitfield manipulation in one op.
ZbcXOR-tree multiplier (~half a MUL)CRC/GF(2) throughput.
Zbkb/Zbkc/Zbkxpack muxes, zip wiring, crossbars; clmul reuseConstant-time cipher kernels — take them with the Zk scalar-crypto bundle.
Dotted-underlined cells have explanations — click one.

Hardware Designer Notes

Done: 51 instructions, roughly one afternoon of datapath and a week of decode verification, for the single largest code-density and string-performance jump available to an RV64 core. The consistency pass for this chapter (and the cross-check against the u36 opcode listings) runs next.

Minimal Linux-boot hart MUST

  • Implement Zba + Zbb + Zbs (= B) for any Linux-class core: RVA23 mandates them and distro binaries assume them
  • Decode zext.h’s fixed-rs2 point exactly — a nonzero rs2 there is pack (Zbkb), a different instruction

MAY simplify / trap-and-emulate

  • Stage the crypto subsets with your Zk plans; nothing in the base OS stack requires them

Check yourself — zext.h & the bitmanip wrap-up

1.zext.h has its own dedicated encoding while zext.b and zext.w don't. Why?

2.Which Zb* subsets does a Linux-class application core actually need?

2 questions