# x86_64: allow for any index register in complex SIB encodings · gitcafe/zig

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

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

Visibility: public

Requested revision: e0167ae0e3f0e6c6a667b372b21c322d47ccd92d

Requested commit: e0167ae0e3f0e6c6a667b372b21c322d47ccd92d

Commit: e0167ae0e3f0e6c6a667b372b21c322d47ccd92d

Tree: 27b8d51339716708ae8398f7683aa7f57e48e245

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
x86_64: allow for any index register in complex SIB encodings

This relieves register pressure, and reduce generated code size
(since now we can use the same index register for both `mov_scale_src`
and `mov_scale_dst` MIR instructions).

Fix lowering of ModRM + SIB encodings where index register is extended
- previously, we would carelessly ignore the fact generating incorrect
encodings.

```

## Parents

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

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