summaryrefslogtreecommitdiff
path: root/hv_func.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2017-04-23 11:59:34 +0200
committerYves Orton <demerphq@gmail.com>2017-04-23 11:59:34 +0200
commit63e6b12834233dc9b98f2b7b63611f958aa88cc6 (patch)
tree0da2bf9ffdd05d35cc4c2b3918d5a675b8322b3d /hv_func.h
parente4343ef32499562ce956ba3cb9cf4454d5d2ff7f (diff)
downloadperl-63e6b12834233dc9b98f2b7b63611f958aa88cc6.tar.gz
Revert "use a specific define for 64 bit hashing"
This reverts commit a4283faf7092ec370914ee3e4e7afeddd0115689. Accidental push. Sorry.
Diffstat (limited to 'hv_func.h')
-rw-r--r--hv_func.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/hv_func.h b/hv_func.h
index f0afe27dbb..d10b5e1d5e 100644
--- a/hv_func.h
+++ b/hv_func.h
@@ -12,17 +12,13 @@
#ifndef PERL_SEEN_HV_FUNC_H /* compile once */
#define PERL_SEEN_HV_FUNC_H
-#if IVSZIE == 8
-#define CAN64BITHASH
-#endif
-
#if !( 0 \
|| defined(PERL_HASH_FUNC_SIPHASH) \
|| defined(PERL_HASH_FUNC_SIPHASH13) \
|| defined(PERL_HASH_FUNC_HYBRID_OAATHU_SIPHASH13) \
|| defined(PERL_HASH_FUNC_ONE_AT_A_TIME_HARD) \
)
-#ifdef CAN64BITHASH
+#if IVSIZE == 8
#define PERL_HASH_FUNC_HYBRID_OAATHU_SIPHASH13
#else
#define PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
@@ -118,7 +114,7 @@
#define UNALIGNED_SAFE
#endif
-#ifdef CAN64BITHASH
+#ifdef HAS_QUAD
#ifndef U64TYPE
/* This probably isn't going to work, but failing with a compiler error due to
lack of uint64_t is no worse than failing right now with an #error. */
@@ -130,13 +126,13 @@
#if defined(_MSC_VER)
#include <stdlib.h> /* Microsoft put _rotl declaration in here */
#define ROTL32(x,r) _rotl(x,r)
- #ifdef CAN64BITHASH
+ #ifdef HAS_QUAD
#define ROTL64(x,r) _rotl64(x,r)
#endif
#else
/* gcc recognises this code and generates a rotate instruction for CPUs with one */
#define ROTL32(x,r) (((U32)x << r) | ((U32)x >> (32 - r)))
- #ifdef CAN64BITHASH
+ #ifdef HAS_QUAD
#define ROTL64(x,r) (((U64)x << r) | ((U64)x >> (64 - r)))
#endif
#endif
@@ -162,7 +158,7 @@
* It is 64 bit only.
*/
-#ifdef CAN64BITHASH
+#ifdef HAS_QUAD
#define U8TO64_LE(p) \
(((U64)((p)[0]) ) | \
@@ -255,7 +251,7 @@ PERL_SIPHASH_FNC(
,SIPROUND;SIPROUND;SIPROUND;SIPROUND;
)
-#endif /* defined(CAN64BITHASH) */
+#endif /* defined(HAS_QUAD) */
/* - ONE_AT_A_TIME_HARD is the 5.17+ recommend ONE_AT_A_TIME variant */
@@ -299,7 +295,7 @@ S_perl_hash_one_at_a_time_hard(const unsigned char * const seed, const unsigned
return (hash + (hash << 15));
}
-#ifdef CAN64BITHASH
+#ifdef HAS_QUAD
/* Hybrid hash function
*
@@ -399,7 +395,7 @@ S_perl_hash_oaathu_siphash_1_3(const unsigned char * const seed, const unsigned
}
return S_perl_hash_siphash_1_3(seed+8, str, len);
}
-#endif /* defined(CAN64BITHASH) */
+#endif /* defined(HAS_QUAD) */
#endif /*compile once*/