[llvm-commits] CVS: llvm/lib/Target/PowerPC/README.txt

Chris Lattner lattner at cs.uiuc.edu
Thu Sep 14 13:56:44 PDT 2006



Changes in directory llvm/lib/Target/PowerPC:

README.txt updated: 1.94 -> 1.95
---
Log message:

add a note


---
Diffs of the changes:  (+25 -0)

 README.txt |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+)


Index: llvm/lib/Target/PowerPC/README.txt
diff -u llvm/lib/Target/PowerPC/README.txt:1.94 llvm/lib/Target/PowerPC/README.txt:1.95
--- llvm/lib/Target/PowerPC/README.txt:1.94	Thu Jul 13 23:07:29 2006
+++ llvm/lib/Target/PowerPC/README.txt	Thu Sep 14 15:56:30 2006
@@ -539,3 +539,28 @@
 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
+






More information about the llvm-commits mailing list