aboutsummaryrefslogtreecommitdiffstats
path: root/test/regression/alias.c
diff options
context:
space:
mode:
authorXavier Leroy <xavierleroy@users.noreply.github.com>2016-10-27 16:26:08 +0200
committerGitHub <noreply@github.com>2016-10-27 16:26:08 +0200
commit9922feea537ced718a3822dd50eabc87da060338 (patch)
tree6f67bb6707ef59e50d6bb81c61b2ed0b3c6097ab /test/regression/alias.c
parentf2d6637c7d4a11f961ff289e64f70bf4de93d0aa (diff)
parentd50773e537ec6729f9152b545c6f938ab19eb7b8 (diff)
downloadcompcert-9922feea537ced718a3822dd50eabc87da060338.tar.gz
compcert-9922feea537ced718a3822dd50eabc87da060338.zip
Merge pull request #145 from AbsInt/64
Support for 64-bit target processors + support for x86 in 64-bit mode
Diffstat (limited to 'test/regression/alias.c')
-rw-r--r--test/regression/alias.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/regression/alias.c b/test/regression/alias.c
index 9887ae2b..925979cb 100644
--- a/test/regression/alias.c
+++ b/test/regression/alias.c
@@ -69,14 +69,14 @@ int get4(void)
return x;
}
-/* Byte-swapping a pointer */
+/* Byte-swapping a pointer. For 32/64 bit compatibility, we just swap
+ the two low bytes, but that's in the spirit. */
inline uintptr_t bswap(uintptr_t x)
{
- return (x >> 24)
- | (((x >> 16) & 0xFF) << 8)
- | (((x >> 8) & 0xFF) << 16)
- | ((x & 0xFF) << 24);
+ return (x & ~((uintptr_t) 0xFFFF))
+ | ((x >> 8) & 0xFF)
+ | ((x << 8) & 0xFF00);
}
void NOINLINE set5(uintptr_t x)