[llvm-commits] CVS: llvm/lib/Target/PowerPC/README.txt
Chris Lattner
sabre at nondot.org
Fri Feb 9 09:38:17 PST 2007
Changes in directory llvm/lib/Target/PowerPC:
README.txt updated: 1.110 -> 1.111
---
Log message:
add a note
---
Diffs of the changes: (+29 -0)
README.txt | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+)
Index: llvm/lib/Target/PowerPC/README.txt
diff -u llvm/lib/Target/PowerPC/README.txt:1.110 llvm/lib/Target/PowerPC/README.txt:1.111
--- llvm/lib/Target/PowerPC/README.txt:1.110 Thu Feb 8 22:19:54 2007
+++ llvm/lib/Target/PowerPC/README.txt Fri Feb 9 11:38:01 2007
@@ -596,3 +596,32 @@
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
+
+===-------------------------------------------------------------------------===
More information about the llvm-commits
mailing list