From 6b57329268eae87edeb2876864bbc96b3cacebcb Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Fri, 15 Mar 2013 10:46:34 -0700 Subject: [PATCH] runtime: use AES hash for compound objects. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/7716047 --- src/pkg/runtime/alg.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pkg/runtime/alg.c b/src/pkg/runtime/alg.c index 124723333f..2dc8212566 100644 --- a/src/pkg/runtime/alg.c +++ b/src/pkg/runtime/alg.c @@ -8,6 +8,8 @@ #define M0 (sizeof(uintptr)==4 ? 2860486313UL : 33054211828000289ULL) #define M1 (sizeof(uintptr)==4 ? 3267000013UL : 23344194077549503ULL) +static bool use_aeshash; + /* * map and chan helpers for * dealing with unknown types @@ -17,6 +19,10 @@ runtime·memhash(uintptr *h, uintptr s, void *a) { byte *b; uintptr hash; + if(use_aeshash) { + runtime·aeshash(h, s, a); + return; + } b = a; hash = M0 ^ *h; @@ -479,6 +485,7 @@ runtime·hashinit(void) (runtime·cpuid_ecx & (1 << 19)) != 0) { // sse4.1 (pinsr{d,q}) byte *rnd; int32 n; + use_aeshash = true; runtime·algarray[AMEM].hash = runtime·aeshash; runtime·algarray[AMEM8].hash = runtime·aeshash; runtime·algarray[AMEM16].hash = runtime·aeshash; -- 2.50.0