[llvm-commits] CVS: llvm/lib/Target/README.txt
Chris Lattner
sabre at nondot.org
Mon Sep 25 10:12:28 PDT 2006
Changes in directory llvm/lib/Target:
README.txt updated: 1.40 -> 1.41
---
Log message:
more notes
---
Diffs of the changes: (+22 -0)
README.txt | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+)
Index: llvm/lib/Target/README.txt
diff -u llvm/lib/Target/README.txt:1.40 llvm/lib/Target/README.txt:1.41
--- llvm/lib/Target/README.txt:1.40 Tue Sep 19 01:19:03 2006
+++ llvm/lib/Target/README.txt Mon Sep 25 12:12:14 2006
@@ -264,3 +264,25 @@
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];
+}
+
+//===---------------------------------------------------------------------===//
More information about the llvm-commits
mailing list