mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-05 01:31:05 +00:00
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34101 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fd57a00972
commit
8abcfe11b5
@ -596,3 +596,32 @@ _test:
|
||||
This sort of thing occurs a lot due to globalopt.
|
||||
|
||||
===-------------------------------------------------------------------------===
|
||||
|
||||
We currently compile 32-bit bswap:
|
||||
|
||||
declare i32 @llvm.bswap.i32(i32 %A)
|
||||
define i32 @test(i32 %A) {
|
||||
%B = call i32 @llvm.bswap.i32(i32 %A)
|
||||
ret i32 %B
|
||||
}
|
||||
|
||||
to:
|
||||
|
||||
_test:
|
||||
rlwinm r2, r3, 24, 16, 23
|
||||
slwi r4, r3, 24
|
||||
rlwimi r2, r3, 8, 24, 31
|
||||
rlwimi r4, r3, 8, 8, 15
|
||||
rlwimi r4, r2, 0, 16, 31
|
||||
mr r3, r4
|
||||
blr
|
||||
|
||||
it would be more efficient to produce:
|
||||
|
||||
_foo: mr r0,r3
|
||||
rlwinm r3,r3,8,0xffffffff
|
||||
rlwimi r3,r0,24,0,7
|
||||
rlwimi r3,r0,24,16,23
|
||||
blr
|
||||
|
||||
===-------------------------------------------------------------------------===
|
||||
|
Loading…
x
Reference in New Issue
Block a user