<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 - can't possibly be optimal ppc code for bswap.i128"
   href="https://bugs.llvm.org/show_bug.cgi?id=43047">43047</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>can't possibly be optimal ppc code for bswap.i128
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>slandden@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This is what I'm getting for this zig:

export fn f(a: u128) u128 {
return @byteSwap(u128, a);
}

which is this llvm-ir:

; ModuleID = 'f'
source_filename = "f"
target datalayout = "e-m:e-i64:64-n32:64"
target triple = "powerpc64le-unknown-linux-gnu"

; Function Attrs: nobuiltin nounwind readnone
define i128 @f(i128) local_unnamed_addr #0 !dbg !4 {
Entry:
  call void @llvm.dbg.value(metadata i128 %0, metadata !10, metadata
!DIExpression()), !dbg !11
  %1 = tail call i128 @llvm.bswap.i128(i128 %0), !dbg !12
  ret i128 %1, !dbg !14
}

; Function Attrs: nounwind readnone speculatable
declare i128 @llvm.bswap.i128(i128) #1


f:
.Lfunc_begin0:
        .file   1 "/tmp/f.zig"
        .loc    1 0 0
        .cfi_sections .debug_frame
        .cfi_startproc
        .loc    1 2 8 prologue_end
        rotldi  6, 4, 16
        rotldi  5, 4, 8
        rotldi  7, 4, 24
        rotldi  8, 3, 16
        rldimi 5, 6, 8, 48
        rotldi  6, 3, 8
        rldimi 6, 8, 8, 48
        rotldi  8, 4, 32
        rldimi 5, 7, 16, 40
        rotldi  7, 3, 24
        rldimi 6, 7, 16, 40
        rotldi  7, 4, 48
        rldimi 5, 8, 24, 32
        rotldi  8, 3, 32
        rldimi 6, 8, 24, 32
        rldimi 5, 7, 40, 16
        rotldi  7, 3, 48
        rotldi  8, 4, 56
        rldimi 6, 7, 40, 16
        rotldi  7, 3, 56
        rldimi 5, 8, 48, 8
        rldimi 6, 7, 48, 8
        rldimi 5, 4, 56, 0
        rldimi 6, 3, 56, 0
        .loc    1 2 1 is_stmt 0
        mr 3, 5
        mr 4, 6
        blr
.Ltmp0:
        .long   0
        .quad   0
.Lfunc_end0:
        .size   f, .Lfunc_end0-.Lfunc_begin0
        .cfi_endproc</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>