mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
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:
parent
516b962b5a
commit
f0613e1e7c
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user