# Liveness: modify encoding to support over 32 operands · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/b0edd8752a00ea191decf302d9802b853d85fd4c)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: b0edd8752a00ea191decf302d9802b853d85fd4c

Requested commit: b0edd8752a00ea191decf302d9802b853d85fd4c

Commit: b0edd8752a00ea191decf302d9802b853d85fd4c

Tree: 67d5bd98e2eff521205d91ea85329e414164bd23

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
Liveness: modify encoding to support over 32 operands

Prior to this, Liveness encoded `asm`, `call`, and `aggregate_init` with
a single 32-bit integer, allowing up to 35 operands (3 are provided by
the regular tomb_bits). However, the Zig language allows function calls
with more than 35 arguments, inline assembly with more than 35 inputs,
and anonymous tuples with more than 35 elements.

The new encoding stores an index to the extra array instead of the bits
directly, and then as many extra elements as needed to encode all the
operands. The MSB is used as a flag to tell which element is the last
one, allowing for 31 bits per element.

Prior to this, print_air did not bother correctly printing tombstones
for these instructions; now it does.

In addition to updating the BigTomb iteration logic in the machine code
backends, this commit extracts the common logic into the Liveness namespace.

```

## Parents

- [17631cb2d30bf2d7b10401cf8f784a599bade5c5](https://git.cafe/gitcafe/zig/commit/17631cb2d30bf2d7b10401cf8f784a599bade5c5?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/b0edd8752a00ea191decf302d9802b853d85fd4c?format=markdown)
