<html>
<head>
<base href="http://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 - [ppc] Slow code for 32-bit bit reversal"
href="http://bugs.llvm.org/show_bug.cgi?id=32815">32815</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[ppc] Slow code for 32-bit bit reversal
</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: PowerPC
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>echristo@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>About half the speed of the equivalent gcc.
Simple testcase:
extern unsigned int bswap_64(unsigned int n);
unsigned int ReverseBits32(unsigned int n) {
n = ((n >> 1) & 0x5555555555555555ULL) | ((n & 0x5555555555555555ULL) << 1);
n = ((n >> 2) & 0x3333333333333333ULL) | ((n & 0x3333333333333333ULL) << 2);
n = ((n >> 4) & 0x0F0F0F0F0F0F0F0FULL) | ((n & 0x0F0F0F0F0F0F0F0FULL) << 4);
return bswap_64(n);
}
echristo@ghostwheel ~/tmp> ~/builds/build-llvm/bin/clang -target
powerpc64le-linux-gnu foo.c -S -O2 -o -
.text
.abiversion 2
.file "foo.c"
.globl ReverseBits32
.p2align 4
.type ReverseBits32,@function
ReverseBits32: # @ReverseBits32
.Lfunc_begin0:
.Lfunc_gep0:
addis 2, 12, .TOC.-.Lfunc_gep0@ha
addi 2, 2, .TOC.-.Lfunc_gep0@l
.Lfunc_lep0:
.localentry ReverseBits32, .Lfunc_lep0-.Lfunc_gep0
# BB#0: # %entry
mflr 0
std 0, 16(1)
stdu 1, -32(1)
rlwinm 4, 3, 25, 0, 31
rlwimi 4, 3, 27, 30, 30
rlwimi 4, 3, 29, 29, 29
rlwimi 4, 3, 31, 28, 28
rlwimi 4, 3, 1, 27, 27
rlwimi 4, 3, 3, 26, 26
rlwimi 4, 3, 5, 25, 25
rlwimi 4, 3, 7, 24, 24
rlwimi 4, 3, 27, 22, 22
rlwimi 4, 3, 29, 21, 21
rlwimi 4, 3, 31, 20, 20
rlwimi 4, 3, 1, 19, 19
rlwimi 4, 3, 3, 18, 18
rlwimi 4, 3, 5, 17, 17
rlwimi 4, 3, 7, 16, 16
rlwimi 4, 3, 27, 14, 14
rlwimi 4, 3, 29, 13, 13
rlwimi 4, 3, 31, 12, 12
rlwimi 4, 3, 1, 11, 11
rlwimi 4, 3, 3, 10, 10
rlwimi 4, 3, 5, 9, 9
rlwimi 4, 3, 7, 8, 8
rlwimi 4, 3, 27, 6, 6
rlwimi 4, 3, 29, 5, 5
rlwimi 4, 3, 31, 4, 4
rlwimi 4, 3, 1, 3, 3
rlwimi 4, 3, 3, 2, 2
rlwimi 4, 3, 5, 1, 1
rlwimi 4, 3, 7, 0, 0
mr 3, 4
bl bswap_64
nop
addi 1, 1, 32
ld 0, 16(1)
mtlr 0
blr
.long 0
.quad 0
.Lfunc_end0:
.size ReverseBits32, .Lfunc_end0-.Lfunc_begin0
.ident "clang version 5.0.0 (trunk 301364) (llvm/trunk 301363)"
.section ".note.GNU-stack","",@progbits</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>