<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - [mc] image_atomic -- issues with unorm (and other modifiers) and dmask."
   href="https://llvm.org/bugs/show_bug.cgi?id=28239">28239</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[mc] image_atomic -- issues with unorm (and other modifiers) and dmask.
          </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>Windows NT
          </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>artem.tamazov@amd.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>artem.tamazov@amd.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, nikolay.haustov@amd.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=16616" name="attach_16616" title="06156.tests_tg_gfx7_asm_lit1_bug.06.08.min.image_atomic_add_etc-modifiers-dmask.zip">attachment 16616</a> <a href="attachment.cgi?id=16616&action=edit" title="06156.tests_tg_gfx7_asm_lit1_bug.06.08.min.image_atomic_add_etc-modifiers-dmask.zip">[details]</a></span>
06156.tests_tg_gfx7_asm_lit1_bug.06.08.min.image_atomic_add_etc-modifiers-dmask.zip

It seems that unorm (and other modifiers) cannot be used without dmask:
<span class="quote">> image_atomic_add v0, v0, s[0:7] dmask:0xF unorm // ok
> image_atomic_add v0, v0, s[0:7]           unorm // failed</span >
it is even more strange taking into account the fact that dmask may be omitted:
<span class="quote">> image_atomic_add v0, v0, s[0:7]                 // ok</span >

Another catch is that assembler produces the *same* encoding for V1 and V4
varieties of instructions, which is definitely wrong. Example:
<span class="quote">> image_atomic_umin v0, v0    , s[0:7] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x54,0xf0,0x00,0x00,0x00,0x00]
>image_atomic_umin v0, v[0:3], s[0:7] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x54,0xf0,0x00,0x00,0x00,0x00]</span >

The issue needs to be carefully verified/investigated.

Some GFX7 lit tests attached.
These tests are not guaranteed to be valid, though.
Tested with r273139 (git # 4a94acfea8bfd6eb6b5809dd40f03e1fa42e673a)</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>