[llvm-bugs] [Bug 43047] New: can't possibly be optimal ppc code for bswap.i128

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 19 10:18:32 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=43047

            Bug ID: 43047
           Summary: can't possibly be optimal ppc code for bswap.i128
           Product: new-bugs
           Version: unspecified
          Hardware: Macintosh
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: slandden at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190819/25499e3a/attachment.html>


More information about the llvm-bugs mailing list