<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 - Missing bswap"
   href="https://bugs.llvm.org/show_bug.cgi?id=47191">47191</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Missing bswap
          </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>Linux
          </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>Common Code Generator Code
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>david.bolvansky@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>64-bit cases:
#include <stdint.h>
#include <cstddef>

uint64_t problem1(uint64_t input) {
  return (((input & 0xFF00000000000000ULL) >> 56) +
          ((input & 0x00FF000000000000ULL) >> 40) +
          ((input & 0x0000FF0000000000ULL) >> 24) +
          ((input & 0x000000FF00000000ULL) >> 8) +
          ((input & 0x00000000000000FFULL) << 56) +
          ((input & 0x000000000000FF00ULL) << 40) +
          ((input & 0x0000000000FF0000ULL) << 24) +
          ((input & 0x00000000FF000000ULL) << 8));
}

uint64_t problem2(uint64_t input) {
  return (((input >> 56) & 0x00000000000000FFULL) ^
          ((input >> 40) & 0x000000000000FF00ULL) ^
          ((input >> 24) & 0x0000000000FF0000ULL) ^
          ((input >> 8) & 0x00000000FF000000ULL) ^
          ((input << 56) & 0xFF00000000000000ULL) ^
          ((input << 40) & 0x00FF000000000000ULL) ^
          ((input << 24) & 0x0000FF0000000000ULL) ^
          ((input << 8) & 0x000000FF00000000ULL));
}

uint64_t problem3(uint64_t input) {
  return (((input & 0xFF00000000000000ULL) >> 56) ^
          ((input & 0x00FF000000000000ULL) >> 40) ^
          ((input & 0x0000FF0000000000ULL) >> 24) ^
          ((input & 0x000000FF00000000ULL) >> 8) ^
          ((input & 0x00000000000000FFULL) << 56) ^
          ((input & 0x000000000000FF00ULL) << 40) ^
          ((input & 0x0000000000FF0000ULL) << 24) ^
          ((input & 0x00000000FF000000ULL) << 8));
}

uint64_t problem4(uint64_t input) {
  return (((input >> 56) & 0x00000000000000FFULL) +
          ((input << 56) & 0xFF00000000000000ULL) +
          ((input >> 40) & 0x000000000000FF00ULL) +
          ((input << 40) & 0x00FF000000000000ULL) +
          ((input >> 24) & 0x0000000000FF0000ULL) +
          ((input << 24) & 0x0000FF0000000000ULL) +
          ((input >> 8) & 0x00000000FF000000ULL) +
          ((input << 8) & 0x000000FF00000000ULL));
}

<a href="https://godbolt.org/z/vzznPz">https://godbolt.org/z/vzznPz</a></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>