aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-09-25 17:12:14 +0000
committerChris Lattner <sabre@nondot.org>2006-09-25 17:12:14 +0000
commitfb981f3feec6decbe24452680b88c0203f9e5fbb (patch)
tree32833bd5db9c9f91668355c207736827b642538a /lib
parent279f053eae35729f449f38e08618664b118806bd (diff)
downloadexternal_llvm-fb981f3feec6decbe24452680b88c0203f9e5fbb.zip
external_llvm-fb981f3feec6decbe24452680b88c0203f9e5fbb.tar.gz
external_llvm-fb981f3feec6decbe24452680b88c0203f9e5fbb.tar.bz2
more notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30598 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/README.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt
index aa34ac7..48298fa 100644
--- a/lib/Target/README.txt
+++ b/lib/Target/README.txt
@@ -264,3 +264,25 @@ It would also be nice to recognize the reg->size doesn't alias reg->node[i], but
alas...
//===---------------------------------------------------------------------===//
+
+This isn't recognized as bswap by instcombine:
+
+unsigned int swap_32(unsigned int v) {
+ v = ((v & 0x00ff00ffU) << 8) | ((v & 0xff00ff00U) >> 8);
+ v = ((v & 0x0000ffffU) << 16) | ((v & 0xffff0000U) >> 16);
+ return v;
+}
+
+//===---------------------------------------------------------------------===//
+
+These should turn into single 16-bit (unaligned?) loads on little/big endian
+processors.
+
+unsigned short read_16_le(const unsigned char *adr) {
+ return adr[0] | (adr[1] << 8);
+}
+unsigned short read_16_be(const unsigned char *adr) {
+ return (adr[0] << 8) | adr[1];
+}
+
+//===---------------------------------------------------------------------===//