[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/10] xxhash: remove qemu_xxhash7
From: |
Alex Bennée |
Subject: |
[PATCH 10/10] xxhash: remove qemu_xxhash7 |
Date: |
Thu, 20 Apr 2023 16:00:09 +0100 |
Now we no longer have users for qemu_xxhash7 we can drop an additional
multiply and rol and make qemu_xxhash6 the implementation. Adjust the
smaller hash functions accordingly.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
include/qemu/xxhash.h | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/include/qemu/xxhash.h b/include/qemu/xxhash.h
index c2dcccadbf..bab7d4ca09 100644
--- a/include/qemu/xxhash.h
+++ b/include/qemu/xxhash.h
@@ -49,7 +49,7 @@
* contiguous in memory.
*/
static inline uint32_t
-qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, uint32_t f, uint32_t g)
+qemu_xxhash6(uint64_t ab, uint64_t cd, uint32_t e, uint32_t f)
{
uint32_t v1 = QEMU_XXHASH_SEED + PRIME32_1 + PRIME32_2;
uint32_t v2 = QEMU_XXHASH_SEED + PRIME32_2;
@@ -86,9 +86,6 @@ qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, uint32_t
f, uint32_t g)
h32 += f * PRIME32_3;
h32 = rol32(h32, 17) * PRIME32_4;
- h32 += g * PRIME32_3;
- h32 = rol32(h32, 17) * PRIME32_4;
-
h32 ^= h32 >> 15;
h32 *= PRIME32_2;
h32 ^= h32 >> 13;
@@ -100,23 +97,17 @@ qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e,
uint32_t f, uint32_t g)
static inline uint32_t qemu_xxhash2(uint64_t ab)
{
- return qemu_xxhash7(ab, 0, 0, 0, 0);
+ return qemu_xxhash6(ab, 0, 0, 0);
}
static inline uint32_t qemu_xxhash4(uint64_t ab, uint64_t cd)
{
- return qemu_xxhash7(ab, cd, 0, 0, 0);
+ return qemu_xxhash6(ab, cd, 0, 0);
}
static inline uint32_t qemu_xxhash5(uint64_t ab, uint64_t cd, uint32_t e)
{
- return qemu_xxhash7(ab, cd, e, 0, 0);
-}
-
-static inline uint32_t qemu_xxhash6(uint64_t ab, uint64_t cd, uint32_t e,
- uint32_t f)
-{
- return qemu_xxhash7(ab, cd, e, f, 0);
+ return qemu_xxhash6(ab, cd, e, 0);
}
/*
--
2.39.2
- [PATCH 04/10] scripts/qapi: document the tool that generated the file, (continued)
- [PATCH 04/10] scripts/qapi: document the tool that generated the file, Alex Bennée, 2023/04/20
- [PATCH 09/10] hw/9pfs: use qemu_xxhash4, Alex Bennée, 2023/04/20
- [PATCH 01/10] *-user: remove the guest_user_syscall tracepoints, Alex Bennée, 2023/04/20
- [PATCH 07/10] trace: remove control-vcpu.h, Alex Bennée, 2023/04/20
- [PATCH 02/10] trace-events: remove the remaining vcpu trace events, Alex Bennée, 2023/04/20
- [PATCH 10/10] xxhash: remove qemu_xxhash7,
Alex Bennée <=
- [PATCH 08/10] tcg: remove the final vestiges of dstate, Alex Bennée, 2023/04/20
- [PATCH 05/10] qapi: make the vcpu parameters deprecated for 8.1, Alex Bennée, 2023/04/20
- [PATCH 06/10] trace: remove code that depends on setting vcpu, Alex Bennée, 2023/04/20