<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [AMDGPU][MC] Some of invalid opcodes can be disassembled but break code emitter"
   href="https://bugs.llvm.org/show_bug.cgi?id=46401">46401</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[AMDGPU][MC] Some of invalid opcodes can be disassembled but break code emitter
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: AMDGPU
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dpreobrazhensky@luxoft.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Some limitations have recently been added on use of f16 inline constants
(change 5f5f566). As a result many previously valid encodings become invalid.
Disassembler is still able to decode them but some of these break code emitter.
For example, the following GFX9 code:

    0xf9,0x72,0x0a,0x7e,0xf0,0x06,0x86,0x00

may be correctly disassembled to an instruction shown below:

    v_cvt_f16_u16_sdwa v5, 0x3800 dst_sel:DWORD dst_unused:UNUSED_PAD
src0_sel:DWORD

However adding '-show-encoding' option breaks code emitter (debug build only).

I updated and run all script-generated tests and found out that the issue
manifests itself with GFX9 SDWA only. However looks like the problem is more
generic. In many cases code emitter manages to encode invalid instructions w/o
breakage.

We should probably revise errors handling in emitter - either relax some checks
or add a mode with these checks disabled. Or we could validate MCInst after
disassembly but before dumping encoding.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>