aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-11-06 21:26:49 +0000
committerChris Lattner <sabre@nondot.org>2006-11-06 21:26:49 +0000
commit8c97c07040a45ef200bf60abf091e064d2fa72f6 (patch)
treeaa7db152c9896bdfdaa649980ab50c44fa532f14
parent1d2bf885dd9f3175a5a2f6c4389eb5acbc180182 (diff)
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31477 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/README.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt
index 7285c1b068..19bd9d137d 100644
--- a/lib/Target/README.txt
+++ b/lib/Target/README.txt
@@ -287,6 +287,22 @@ unsigned int swap_32(unsigned int v) {
return v;
}
+Nor is this:
+
+ushort %bad(ushort %a) {
+entry:
+ %tmp = cast ushort %a to uint ; <uint> [#uses=1]
+ %tmp2 = shr uint %tmp, ubyte 8 ; <uint> [#uses=1]
+ %tmp2 = cast uint %tmp2 to ushort ; <ushort> [#uses=1]
+ %tmp5 = shl ushort %a, ubyte 8 ; <ushort> [#uses=1]
+ %tmp6 = or ushort %tmp2, %tmp5 ; <ushort> [#uses=1]
+ ret ushort %tmp6
+}
+
+unsigned short bad(unsigned short a) {
+ return ((a & 0xff00) >> 8 | (a & 0x00ff) << 8);
+}
+
//===---------------------------------------------------------------------===//
These should turn into single 16-bit (unaligned?) loads on little/big endian