Port of packed_dim(): byte count for dim elements at bits width (bits===8 is one byte/element, unpacked). Throws on a non-byte-aligned product, matching the reference's own guard.
dim
bits
Port of packed_dim(): byte count for
dimelements atbitswidth (bits===8 is one byte/element, unpacked). Throws on a non-byte-aligned product, matching the reference's own guard.