[llvm-bugs] [Bug 32817] New: [ppc] Slow code for rotate shift and add

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Apr 26 12:46:00 PDT 2017


            Bug ID: 32817
           Summary: [ppc] Slow code for rotate shift and add
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: PowerPC
          Assignee: unassignedbugs at nondot.org
          Reporter: echristo at gmail.com
                CC: llvm-bugs at lists.llvm.org

Seems to go about 25% slower than the gcc equivalent.

echristo at athyra ~/tmp> cat bar.c
unsigned int bar(int k, unsigned int x) {
  return ((1 + (x >> k)) + k);
echristo at athyra ~/tmp> clang -target powerpc64le-linux-gnu -S -O2 -o - bar.c
        .abiversion 2
        .file   "bar.c"
        .globl  bar
        .p2align        4
        .type   bar, at function
bar:                                    # @bar
# BB#0:
        srw 4, 4, 3
        add 3, 3, 4
        addi 3, 3, 1
        clrldi   3, 3, 32
        .long   0
        .quad   0
        .size   bar, .Lfunc_end0-.Lfunc_begin0

        .ident  "clang version google3-trunk (trunk r301047)"
        .section        ".note.GNU-stack","", at progbits
echristo at athyra ~/tmp> powerpc64le-linux-gnu-gcc -S -O2 -o - bar.c
        .file   "bar.c"
        .abiversion 2
        .section        ".toc","aw"
        .section        ".text"
        .machine power8
        .align 2
        .p2align 4,,15
        .globl bar
        .type   bar, @function
        addi 9,3,1
        srw 4,4,3
        add 3,9,4
        rldicl 3,3,0,32
        .long 0
        .byte 0,0,0,0,0,0,0,0
        .size   bar,.-bar
        .ident  "GCC:
(Google_crosstoolv18-gcc-4.9.x-powerpc64le-grtev4-linux-gnu) 4.9.x-google"
        .section        .note.GNU-stack,"", at progbits

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/20170426/7bf94171/attachment.html>

More information about the llvm-bugs mailing list