From 02a2f33279c6ad678d8b241d4622158ae07375e6 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 8 Dec 2006 02:01:32 +0000 Subject: [PATCH] add a note llvm-svn: 32347 --- lib/Target/README.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/Target/README.txt b/lib/Target/README.txt index 422d0216551..c04e06fbfe0 100644 --- a/lib/Target/README.txt +++ b/lib/Target/README.txt @@ -303,6 +303,16 @@ unsigned int swap_32(unsigned int v) { return v; } +Nor is this (yes, it really is bswap): + +unsigned long reverse(unsigned v) { + unsigned t; + t = v ^ ((v << 16) | (v >> 16)); + t &= ~0xff0000; + v = (v << 24) | (v >> 8); + return v ^ (t >> 8); +} + //===---------------------------------------------------------------------===// These should turn into single 16-bit (unaligned?) loads on little/big endian