<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/59949>59949</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Unclear error message for incorrect "movzx"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          efriedma-quic
      </td>
    </tr>
</table>

<pre>
    For the following input (on x86):

```
movzx (%r10), %rax
```

llvm-mc gives the following error:

```
<stdin>:1:15: error: invalid operand for instruction
movzx (%r10), %rax
              ^~~~
```

The error is technically correct from the assembler's perspective, but it's not clear why it's not valid.  This case is particularly nasty because the GNU assembler treats this as if the user wrote `movzbq`.

Multiple complaints about this online:

https://github.com/llvm/llvm-project/issues/7831#issuecomment-980886607
https://stackoverflow.com/questions/40229347/movxz-into-register-invalid-operand-for-instruction
https://discourse.llvm.org/t/clang-compilation-triggered-invalid-operand-for-instruction-build-error/
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVMuynDYQ_RqxUTElxGNgweLGNlklK_sDhGigEyFx1dLMHS_ut6fEjF-3XE4qFIjSq885rdNSRLhYgJ7Vv7H6faZiWJ3vYfYI06by54g6G9106wfneViBz84Yd0W7cLR7DJzJ1ln-0jZMdqx8YuI9E1_aRjzeo7u5y-eXtJ7J2hcirZfveOqol59uuLfGXLZ803zBC9AbCuC9879GZeU7ChNaVn5g5VORvpqVT1-3crQXZXDibgev7MRn5zlaCj7qgM7-V-78h4fVH15fX3-h6uMKdwociQfQq0WtjLlx7bwHHfjs3XaoVUSwjQY8k2fiO3jaQQe8QGIwxsAxHDPWBa4NKM-v6-37wUPeifOPKxLXiiBB7soH1NEob27cKgo3PoJWkeAA_f3PT9-AefCgQso9ElfEcT7WRALPr94F4KwRKUPjM2vE6XuZf0QTcDfAtdt2o9AG4mp0MdyDOWvQwpsDXEPYKY3JgclhwbDG8aTdxuSQvPD45bt3f4EOTA5IFIGYHM5tWTBZHn3ttg1syLtWtG3TiPPPglNQ-m93AT8bd31gPEegdPApYCWk7MrqzOSwucvL5xxtcLmHBSmAzx_WyR_WyWeXxt5Y50fECUm76AlOScTJ-YXJIYnQRtklT2lCo9LuPHhcFvAw_RtOPkY0U353tByyqS-nruxUBn3RnMuqqTtRZWtftMVYTLUQYzGeK91W5dQU1VyIup0aeW4z7KWQpSiKoujKVlYnUYu6KeaxFbrS52pklYBNoflKPjty3dddV3WZUSMYOq4SKS1c-THJpEw3i--PUxvjQqwSBinQtygBg4H-k737914XGxCpBR71-KUsmJRHLTIps-hN___NcnD-JwAA__-qG5a3">