add a note

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30377 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-09-14 20:56:30 +00:00
parent 516b962b5a
commit f0613e1e7c

View File

@ -539,3 +539,28 @@ be folded together.
unsigned short G;
void foo(unsigned long H) { G = H; }
===-------------------------------------------------------------------------===
We compile:
unsigned test6(unsigned x) {
return ((x & 0x00FF0000) >> 16) | ((x & 0x000000FF) << 16);
}
into:
_test6:
lis r2, 255
rlwinm r3, r3, 16, 0, 31
ori r2, r2, 255
and r3, r3, r2
blr
GCC gets it down to:
_test6:
rlwinm r0,r3,16,8,15
rlwinm r3,r3,16,24,31
or r3,r3,r0
blr