We compile this into:
authorChris Lattner <sabre@nondot.org>
Thu, 24 Aug 2006 23:06:02 +0000 (23:06 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 24 Aug 2006 23:06:02 +0000 (23:06 +0000)
_swap_16:
        slwi r2, r3, 24
        rlwimi r2, r3, 8, 8, 15
        srwi r3, r2, 16
        blr

now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29864 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/README.txt

index cf240062fe75ce1e222198bd7ac9757078f7ab64..86c231bf319609e3b9e7f20bc61cd556a15f4583 100644 (file)
@@ -162,24 +162,6 @@ target!
 
 //===---------------------------------------------------------------------===//
 
-Consider this:
-
-unsigned short swap_16(unsigned short v) { return (v>>8) | (v<<8); }
-
-Compiled with the ppc backend:
-
-_swap_16:
-        slwi r2, r3, 8
-        srwi r3, r3, 8
-        or r2, r3, r2
-        rlwinm r3, r2, 0, 16, 31
-        blr
-
-The rlwinm (an and by 65535) is dead.  The dag combiner should propagate bits
-better than that to see this.
-
-//===---------------------------------------------------------------------===//
-
 Add support for conditional increments, and other related patterns.  Instead
 of: