[PATCH] powerpc: provide __bswapdi2

David Woodhouse dwmw2 at infradead.org
Mon May 13 20:33:07 EST 2013


On Mon, 2013-05-13 at 17:09 +1000, Michael Neuling wrote:
> 
> This doesn't work for me but the below does:
 ...
> 
> stolen from GCC -02 output of:
>   unsigned long long __bswapdi2(unsigned long long x)

Hm, so was mine:

[dwmw2 at i7 ~]$ powerpc64-linux-gnu-gcc -O2 -S -o- bswapdi2.c -m32
	.file	"bswapdi2.c"
	.section	".text"
	.align 2
	.p2align 4,,15
	.globl __bswapdi2
	.type	__bswapdi2, @function
__bswapdi2:
	rlwinm 10,4,8,0xffffffff
	rlwinm 11,3,8,0xffffffff
	rlwimi 10,4,24,0,7
	rlwimi 11,3,24,0,7
	rlwimi 10,4,24,16,23
	rlwimi 11,3,24,16,23
	mr 4,11
	mr 3,10
	blr
	.size	__bswapdi2,.-__bswapdi2
	.ident	"GCC: (GNU) 4.7.2 20121105 (Red Hat 4.7.2-2.aa.20121114svn)"

On Mon, 2013-05-13 at 09:33 +0200, Gabriel Paubert wrote:
> Actually, I'd swap the two mr instructions to never
> have an instruction that uses the result from the
> previous one. 

Bad GCC. No biscuit.

Should we file a PR? 

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse at intel.com                              Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5745 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20130513/db08bb42/attachment.bin>


More information about the Linuxppc-dev mailing list