[llvm-commits] [llvm] r114303 - /llvm/trunk/lib/Target/PowerPC/README.txt
Chris Lattner
sabre at nondot.org
Sat Sep 18 17:34:58 PDT 2010
Author: lattner
Date: Sat Sep 18 19:34:58 2010
New Revision: 114303
URL: http://llvm.org/viewvc/llvm-project?rev=114303&view=rev
Log:
add a readme.
Modified:
llvm/trunk/lib/Target/PowerPC/README.txt
Modified: llvm/trunk/lib/Target/PowerPC/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/README.txt?rev=114303&r1=114302&r2=114303&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/README.txt (original)
+++ llvm/trunk/lib/Target/PowerPC/README.txt Sat Sep 18 19:34:58 2010
@@ -37,6 +37,31 @@
ori r3, r2, 65535
blr
+===-------------------------------------------------------------------------===
+
+This code:
+
+unsigned add32carry(unsigned sum, unsigned x) {
+ unsigned z = sum + x;
+ if (sum + x < x)
+ z++;
+ return z;
+}
+
+Should compile to something like:
+
+ addc r3,r3,r4
+ addze r3,r3
+
+instead we get:
+
+ add r3, r4, r3
+ cmplw cr7, r3, r4
+ mfcr r4 ; 1
+ rlwinm r4, r4, 29, 31, 31
+ add r3, r3, r4
+
+Ick.
===-------------------------------------------------------------------------===
More information about the llvm-commits
mailing list