diff options
author | Chris Lattner <sabre@nondot.org> | 2006-04-20 18:49:28 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-04-20 18:49:28 +0000 |
commit | 879acefed5e710764eef6018d843107a8092dfd0 (patch) | |
tree | 721012eadc6894e76bc53ed19cbb65a5c454dd08 | |
parent | 118af5f6d632c8969468c42ae578d9228f20f4d0 (diff) |
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27907 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/README.txt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt index 23503517c0..fd862fe63a 100644 --- a/lib/Target/README.txt +++ b/lib/Target/README.txt @@ -172,3 +172,21 @@ information in the constant folder, so we don't know the endianness of the 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. + +//===---------------------------------------------------------------------===// |