aboutsummaryrefslogtreecommitdiffstats
path: root/test/regression/alias.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2016-10-01 17:25:18 +0200
committerXavier Leroy <xavier.leroy@inria.fr>2016-10-01 17:25:18 +0200
commite637d041c5c2ee3a3ed395a7dab6c9101e8eb16c (patch)
tree518d558674d3e1c6ff41c46d84c784e727ed5d04 /test/regression/alias.c
parentad2a2c862abef3aee701d1bca0524fcbf2d07b30 (diff)
downloadcompcert-kvx-e637d041c5c2ee3a3ed395a7dab6c9101e8eb16c.tar.gz
compcert-kvx-e637d041c5c2ee3a3ed395a7dab6c9101e8eb16c.zip
Support for 64-bit architectures: generic support
- Introduce Archi.ptr64 parameter. - Define module Ptrofs of integers as wide as a pointer (64 if Archi.ptr64, 32 otherwise). - Use Ptrofs.int as the offset type for Vptr values and anywhere pointer offsets are manipulated. - Modify Val operations that handle pointers (e.g. Val.add, Val.sub, Val.cmpu) so that in 64-bit pointer mode it is the "long" operation (e.g. Val.addl, Val.subl, Val.cmplu) that handles pointers. - Update the memory model accordingly. - Modify C operations that handle pointers (e.g. addition, subtraction, comparisons) accordingly. - Make it possible to turn off the splitting of 64-bit integers into pairs of 32-bit integers. - Update the compiler front-end and back-end accordingly.
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)