diff mbox series

[4/4] xxhash: match output against the original xxhash32

Message ID 20181123230206.12629-5-cota@braap.org
State New
Headers show
Series None | expand

Commit Message

Emilio Cota Nov. 23, 2018, 11:02 p.m. UTC
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

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 include/qemu/xxhash.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Alex Bennée Nov. 28, 2018, 3:09 p.m. UTC | #1
Emilio G. Cota <cota@braap.org> writes:

> 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
>
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>  include/qemu/xxhash.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/qemu/xxhash.h b/include/qemu/xxhash.h
> index fe35dde328..076f1f6054 100644
> --- a/include/qemu/xxhash.h
> +++ b/include/qemu/xxhash.h
> @@ -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;


--
Alex Bennée
diff mbox series

Patch

diff --git a/include/qemu/xxhash.h b/include/qemu/xxhash.h
index fe35dde328..076f1f6054 100644
--- a/include/qemu/xxhash.h
+++ b/include/qemu/xxhash.h
@@ -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;