]> git.proxmox.com Git - mirror_qemu.git/commitdiff
xxhash: match output against the original xxhash32
authorEmilio G. Cota <cota@braap.org>
Fri, 23 Nov 2018 22:41:43 +0000 (17:41 -0500)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 17 Dec 2018 03:04:44 +0000 (06:04 +0300)
Change the order in which we extract a/b and c/d to
match the output of the upstream xxhash32.

Tested with:
  https://github.com/cota/xxhash/tree/qemu

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
include/qemu/xxhash.h

index fe35dde328f94ec43e7a3c76e3ee8ef2a47d4cc0..076f1f605447930f466f794ba61b17b514136ee5 100644 (file)
@@ -55,10 +55,10 @@ qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, uint32_t f, uint32_t g)
     uint32_t v2 = QEMU_XXHASH_SEED + PRIME32_2;
     uint32_t v3 = QEMU_XXHASH_SEED + 0;
     uint32_t v4 = QEMU_XXHASH_SEED - PRIME32_1;
-    uint32_t a = ab >> 32;
-    uint32_t b = ab;
-    uint32_t c = cd >> 32;
-    uint32_t d = cd;
+    uint32_t a = ab;
+    uint32_t b = ab >> 32;
+    uint32_t c = cd;
+    uint32_t d = cd >> 32;
     uint32_t h32;
 
     v1 += a * PRIME32_2;