<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 - Misoptimizations caused by "[ARM] Fix conditions for lowering to S[LR]I""
   href="https://bugs.llvm.org/show_bug.cgi?id=45610">45610</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Misoptimizations caused by "[ARM] Fix conditions for lowering to S[LR]I"
          </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: AArch64
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>martin@martin.st
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>arnaud.degrandmaison@arm.com, llvm-bugs@lists.llvm.org, smithp352@googlemail.com, Ties.Stuij@arm.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This commit, "[ARM] Fix conditions for lowering to S[LR]I"
<a href="https://reviews.llvm.org/D77387">https://reviews.llvm.org/D77387</a>, causes misoptimizations to the following
function:

$ cat test.c
void rgb16to24(const unsigned char *src, unsigned char *dst, int src_size) {
    unsigned char *d = dst;
    const unsigned short *s = (const unsigned short *)src;
    const unsigned short *end = s + src_size / 2;

    while (s < end) {
        unsigned short bgr = *s++;
        *d++ = ((bgr&0xF800)>>8) | ((bgr&0xF800)>>13);
        *d++ = ((bgr&0x07E0)>>3) | ((bgr&0x07E0)>> 9);
        *d++ = ((bgr&0x001F)<<3) | ((bgr&0x001F)>> 2);
    }
}

Compiled e.g. like this:

$ clang -target aarch64-linux-gnu -S -O3 test.c -o test.s

I haven't pinpointed which bit of the change in the output is wrong, but
running the function as part of a testsuite points it out as incorrect.</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>