summaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/README.txt
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-23 18:42:37 +0000
committerChris Lattner <sabre@nondot.org>2010-01-23 18:42:37 +0000
commita9cf5b3cc9082acee5b6e30e989a667fed286b05 (patch)
tree4e4e777c5576255d0f9daf2d0896d747a02df8a2 /lib/Target/PowerPC/README.txt
parentaa306c2cc1945b3e68c8cf2925e9b1197126d54c (diff)
downloadllvm-a9cf5b3cc9082acee5b6e30e989a667fed286b05.tar.gz
llvm-a9cf5b3cc9082acee5b6e30e989a667fed286b05.tar.bz2
llvm-a9cf5b3cc9082acee5b6e30e989a667fed286b05.tar.xz
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94317 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/README.txt')
-rw-r--r--lib/Target/PowerPC/README.txt29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/README.txt b/lib/Target/PowerPC/README.txt
index 060d6a5c5c..a243543cd4 100644
--- a/lib/Target/PowerPC/README.txt
+++ b/lib/Target/PowerPC/README.txt
@@ -635,6 +635,35 @@ This sort of thing occurs a lot due to globalopt.
===-------------------------------------------------------------------------===
+We compile:
+
+define i32 @bar(i32 %x) nounwind readnone ssp {
+entry:
+ %0 = icmp eq i32 %x, 0 ; <i1> [#uses=1]
+ %neg = select i1 %0, i32 -1, i32 0 ; <i32> [#uses=1]
+ ret i32 %neg
+}
+
+to:
+
+_bar:
+ cmplwi cr0, r3, 0
+ li r3, -1
+ beq cr0, LBB1_2
+; BB#1: ; %entry
+ li r3, 0
+LBB1_2: ; %entry
+ blr
+
+it would be much better to produce:
+
+_bar:
+ addic r3,r3,-1
+ subfe r3,r3,r3
+ blr
+
+===-------------------------------------------------------------------------===
+
We currently compile 32-bit bswap:
declare i32 @llvm.bswap.i32(i32 %A)