add a note

llvm-svn: 27907
This commit is contained in:
Chris Lattner 2006-04-20 18:49:28 +00:00
parent 53345be5e2
commit d1c3a067ee
1 changed files with 18 additions and 0 deletions

View File

@ -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.
//===---------------------------------------------------------------------===//