summaryrefslogtreecommitdiff
path: root/byterun/int64_native.h
diff options
context:
space:
mode:
Diffstat (limited to 'byterun/int64_native.h')
-rw-r--r--byterun/int64_native.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/byterun/int64_native.h b/byterun/int64_native.h
index 5e84dda61d..09b5d65e89 100644
--- a/byterun/int64_native.h
+++ b/byterun/int64_native.h
@@ -49,4 +49,13 @@
#define I64_to_double(x) ((double)(x))
#define I64_of_double(x) ((int64)(x))
+#define I64_bswap(x) ((((x) & 0x00000000000000FF) << 56) | \
+ (((x) & 0x000000000000FF00) << 40) | \
+ (((x) & 0x0000000000FF0000) << 24) | \
+ (((x) & 0x00000000FF000000) << 8) | \
+ (((x) & 0x000000FF00000000) >> 8) | \
+ (((x) & 0x0000FF0000000000) >> 24) | \
+ (((x) & 0x00FF000000000000) >> 40) | \
+ (((x) & 0xFF00000000000000) >> 56))
+
#endif /* CAML_INT64_NATIVE_H */