From nobody Fri May 3 14:14:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1543014256862653.9345024627313; Fri, 23 Nov 2018 15:04:16 -0800 (PST) Received: from localhost ([::1]:54522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQKUX-0000zM-DU for importer@patchew.org; Fri, 23 Nov 2018 18:04:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQKSr-0007hG-AG for qemu-devel@nongnu.org; Fri, 23 Nov 2018 18:02:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQKSo-00028m-34 for qemu-devel@nongnu.org; Fri, 23 Nov 2018 18:02:21 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:40367) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gQKSn-000258-My for qemu-devel@nongnu.org; Fri, 23 Nov 2018 18:02:17 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 0FD2E22012; Fri, 23 Nov 2018 18:02:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 23 Nov 2018 18:02:17 -0500 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 8373B102DE; Fri, 23 Nov 2018 18:02:16 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h= from:to:cc:subject:date:message-id:in-reply-to:references; s= mesmtp; bh=fHKQErIpiTeZxGnXiYW9ltzcm1c71Mei3D8s3urLjpY=; b=HJzjc kyBG3mx5VkojImVeLSymHWOHx9pDqHkShjreh5uJtB8dQXtcu+rhvt34SOwhh4sH ZH5Zg5s9exVAcRPgy7Y7K8DJi8jpRDvoIBn7CnfXkqJUBdM8WTV5VfYlsG4PTz/E XWPg17LHz/w0huyW4FotaPLYJvM49OtQlJ9wmU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=fHKQErIpiTeZxGnXiYW9ltzcm1c71 Mei3D8s3urLjpY=; b=mOmrOvbZJbVuMqayt/34IDrGeKvLPDVHLW3I3XA4RiHRB UiGSuAN9AiVrJhveF1pc9c9JanQ1XvFJGoe0e9re1VIatvrXGWMoYG55cUOiOLsK cCnfGBNcux6KC9qVm0yBRwP06Cs4SThL2bzeLjhoU/0dZbs6Q5tY19Gg8cALmBEg R1GzKyWS005u73/V607FrcOlbkje4GHxz2BhahPtr2p03qvVmysXqVPbp10jnDB6 wEUXZd+aJlMPr2dgwzQ8zgAmdDnBMcB87kpBCvAKjXOkpuzi5finHumuvEyR0kuI 1YPRvioKhvxLp+Eom0dGroXBzOEMeQMijCp6iujBg== X-ME-Sender: X-ME-Proxy: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Fri, 23 Nov 2018 18:02:03 -0500 Message-Id: <20181123230206.12629-2-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181123230206.12629-1-cota@braap.org> References: <20181123230206.12629-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.28 Subject: [Qemu-devel] [PATCH 1/4] qht-bench: document -p flag X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Which we forgot to do in bd224fce60 ("qht-bench: add -p flag to precompute hash values", 2018-09-26). Signed-off-by: Emilio G. Cota Reviewed-by: Alex Benn=C3=A9e --- tests/qht-bench.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qht-bench.c b/tests/qht-bench.c index 2089e2bed1..636750d39f 100644 --- a/tests/qht-bench.c +++ b/tests/qht-bench.c @@ -72,6 +72,7 @@ static const char commands_string[] =3D " -n =3D number of threads\n" "\n" " -o =3D offset at which keys start\n" + " -p =3D precompute hashes\n" "\n" " -g =3D set -s,-k,-K,-l,-r to the same value\n" " -s =3D initial size hint\n" --=20 2.17.1 From nobody Fri May 3 14:14:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1543014369789838.1467471797969; Fri, 23 Nov 2018 15:06:09 -0800 (PST) Received: from localhost ([::1]:54533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQKWP-0002F1-Mr for importer@patchew.org; Fri, 23 Nov 2018 18:06:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQKSr-0007hE-AJ for qemu-devel@nongnu.org; Fri, 23 Nov 2018 18:02:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQKSo-00028x-3j for qemu-devel@nongnu.org; Fri, 23 Nov 2018 18:02:21 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:42441) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gQKSn-00025A-N0 for qemu-devel@nongnu.org; Fri, 23 Nov 2018 18:02:18 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 10C9022022; Fri, 23 Nov 2018 18:02:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 23 Nov 2018 18:02:17 -0500 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id B2450102ED; Fri, 23 Nov 2018 18:02:16 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mesmtp; bh=H7fydDZmif9Ml201vPVIQl2UXjXhuDTudmlbaUlANvU=; b=HdPDaykjn8Jc 5lJlKUwG/gt0+mfcabhjYorL2XKXW9whTCYyZEfVhMEAPLmyGgAT6HKvsr+Pa3UR va74unIyhGJ9F3uQlZSj8h7s9Xt2dhKsKHvXHcbtPrkiMxl7l0grPpgttUYIcAsx TtLngXqlHT3TEcdKFiqwiWA+6JXQEQY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=H7fydDZmif9Ml201vPVIQl2UXjXhuDTudmlbaUlAN vU=; b=X8eYhAZopmpwXSjesz3iOiWkqRSzGZrY/D1Qr5aWjNnwhPYABSlUJkli6 wAjcd3R5M3+xl4RJv2gH8HuqXHcXb/vY9DNitTSusdPYqAn4g7IgFE6opYDixLim UzausM72DYPDvZbheG1Af9eaaUtnR9Y60J3Lq7tF2/bdIZkI33DvDGsxmGT98xAE DIHY1OEcWCeLBvwSNbviurMGiEHUjG/imKQxUKLn28FHhhPFaXRPF+M4JmHsK3Zf bap5uuoPUbmoAooQ6+Sy4WBRv4mXZo80GrdDhoC3uE/cj5aI5dXQ5qiDU+Q2S2M2 wJDQguhen/DsPuM1SSprxgogtYgbQ== X-ME-Sender: X-ME-Proxy: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Fri, 23 Nov 2018 18:02:04 -0500 Message-Id: <20181123230206.12629-3-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181123230206.12629-1-cota@braap.org> References: <20181123230206.12629-1-cota@braap.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.28 Subject: [Qemu-devel] [PATCH 2/4] exec: introduce qemu_xxhash{2,4,5,6,7} X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Before moving them all to include/qemu/xxhash.h. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Emilio G. Cota --- include/exec/tb-hash-xx.h | 41 +++++++++++++++++++++++++++++---------- include/exec/tb-hash.h | 2 +- tests/qht-bench.c | 2 +- util/qsp.c | 12 ++++++------ 4 files changed, 39 insertions(+), 18 deletions(-) diff --git a/include/exec/tb-hash-xx.h b/include/exec/tb-hash-xx.h index 747a9a612c..98ce4b628a 100644 --- a/include/exec/tb-hash-xx.h +++ b/include/exec/tb-hash-xx.h @@ -42,23 +42,23 @@ #define PRIME32_4 668265263U #define PRIME32_5 374761393U =20 -#define TB_HASH_XX_SEED 1 +#define QEMU_XXHASH_SEED 1 =20 /* * xxhash32, customized for input variables that are not guaranteed to be * contiguous in memory. */ static inline uint32_t -tb_hash_func7(uint64_t a0, uint64_t b0, uint32_t e, uint32_t f, uint32_t g) +qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, uint32_t f, uint32_t g) { - uint32_t v1 =3D TB_HASH_XX_SEED + PRIME32_1 + PRIME32_2; - uint32_t v2 =3D TB_HASH_XX_SEED + PRIME32_2; - uint32_t v3 =3D TB_HASH_XX_SEED + 0; - uint32_t v4 =3D TB_HASH_XX_SEED - PRIME32_1; - uint32_t a =3D a0 >> 32; - uint32_t b =3D a0; - uint32_t c =3D b0 >> 32; - uint32_t d =3D b0; + uint32_t v1 =3D QEMU_XXHASH_SEED + PRIME32_1 + PRIME32_2; + uint32_t v2 =3D QEMU_XXHASH_SEED + PRIME32_2; + uint32_t v3 =3D QEMU_XXHASH_SEED + 0; + uint32_t v4 =3D QEMU_XXHASH_SEED - PRIME32_1; + uint32_t a =3D ab >> 32; + uint32_t b =3D ab; + uint32_t c =3D cd >> 32; + uint32_t d =3D cd; uint32_t h32; =20 v1 +=3D a * PRIME32_2; @@ -98,4 +98,25 @@ tb_hash_func7(uint64_t a0, uint64_t b0, uint32_t e, uint= 32_t f, uint32_t g) return h32; } =20 +static inline uint32_t qemu_xxhash2(uint64_t ab) +{ + return qemu_xxhash7(ab, 0, 0, 0, 0); +} + +static inline uint32_t qemu_xxhash4(uint64_t ab, uint64_t cd) +{ + return qemu_xxhash7(ab, cd, 0, 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); +} + #endif /* EXEC_TB_HASH_XX_H */ diff --git a/include/exec/tb-hash.h b/include/exec/tb-hash.h index 0526c4f678..731ba4c272 100644 --- a/include/exec/tb-hash.h +++ b/include/exec/tb-hash.h @@ -61,7 +61,7 @@ static inline uint32_t tb_hash_func(tb_page_addr_t phys_pc, target_ulong pc, uint32_t fl= ags, uint32_t cf_mask, uint32_t trace_vcpu_dstate) { - return tb_hash_func7(phys_pc, pc, flags, cf_mask, trace_vcpu_dstate); + return qemu_xxhash7(phys_pc, pc, flags, cf_mask, trace_vcpu_dstate); } =20 #endif diff --git a/tests/qht-bench.c b/tests/qht-bench.c index 636750d39f..0278f4da04 100644 --- a/tests/qht-bench.c +++ b/tests/qht-bench.c @@ -105,7 +105,7 @@ static bool is_equal(const void *ap, const void *bp) =20 static uint32_t h(unsigned long v) { - return tb_hash_func7(v, 0, 0, 0, 0); + return qemu_xxhash2(v); } =20 static uint32_t hval(unsigned long v) diff --git a/util/qsp.c b/util/qsp.c index a848b09c6d..dc29c41fde 100644 --- a/util/qsp.c +++ b/util/qsp.c @@ -135,13 +135,13 @@ QemuCondWaitFunc qemu_cond_wait_func =3D qemu_cond_wa= it_impl; * without it we still get a pretty unique hash. */ static inline -uint32_t do_qsp_callsite_hash(const QSPCallSite *callsite, uint64_t a) +uint32_t do_qsp_callsite_hash(const QSPCallSite *callsite, uint64_t ab) { - uint64_t b =3D (uint64_t)(uintptr_t)callsite->obj; + uint64_t cd =3D (uint64_t)(uintptr_t)callsite->obj; uint32_t e =3D callsite->line; uint32_t f =3D callsite->type; =20 - return tb_hash_func7(a, b, e, f, 0); + return qemu_xxhash6(ab, cd, e, f); } =20 static inline @@ -169,11 +169,11 @@ static uint32_t qsp_entry_no_thread_hash(const QSPEnt= ry *entry) static uint32_t qsp_entry_no_thread_obj_hash(const QSPEntry *entry) { const QSPCallSite *callsite =3D entry->callsite; - uint64_t a =3D g_str_hash(callsite->file); - uint64_t b =3D callsite->line; + uint64_t ab =3D g_str_hash(callsite->file); + uint64_t cd =3D callsite->line; uint32_t e =3D callsite->type; =20 - return tb_hash_func7(a, b, e, 0, 0); + return qemu_xxhash5(ab, cd, e); } =20 static bool qsp_callsite_cmp(const void *ap, const void *bp) --=20 2.17.1 From nobody Fri May 3 14:14:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1543014441401993.2821657525727; Fri, 23 Nov 2018 15:07:21 -0800 (PST) Received: from localhost ([::1]:54537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQKXg-00032F-DE for importer@patchew.org; Fri, 23 Nov 2018 18:07:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQKSr-0007h8-A6 for qemu-devel@nongnu.org; Fri, 23 Nov 2018 18:02:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQKSo-000292-3X for qemu-devel@nongnu.org; Fri, 23 Nov 2018 18:02:21 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:56317) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gQKSn-00025P-Mz for qemu-devel@nongnu.org; Fri, 23 Nov 2018 18:02:17 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4C43521F4D; Fri, 23 Nov 2018 18:02:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 23 Nov 2018 18:02:17 -0500 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id E7DD5102EE; Fri, 23 Nov 2018 18:02:16 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mesmtp; bh=MmzFXIptzCqCQHbpVfKBBNOEu7E5najYP+hSDNJTSnw=; b=cNO+Zm1ipz78 qVDDdr/lQ1re2nF0lGbbcJM9LDSmSEWBkXcYub6xApEWv8gS+sXFUrCW39Vz13tW 7vmYLShFZlFKAz+RGl1JbI9wZq7bRM2ccPuqA1knSkbJTCd1+mGtuahhBw5sBS1m BObt+TvQmajnP74iP84kKun7sGS6U7c= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=MmzFXIptzCqCQHbpVfKBBNOEu7E5najYP+hSDNJTS nw=; b=KL2nKtwOiX15D00wI8aVe8wakBv8Fewlafol0vj0hE5T+nmurhJh7jd7J LpJcoD5yv7alzFuRI5MJh+tgPJKw2BtA4VjteYdAgg/WONKICf3TDCTx1e9SlA1h UrGjdsm/Ccuz9/IVs8tVXz/mrjAnc361vOr/m6WB0Ns/jAbQxGbN+9tr1mpLmvND PFuVbr9cgzLmpW3+Gz3Tl0W0gb73Jtvl2wQLRm/wjZCmN9FF+5NJ2WU8iXcR3eDm 3+39c/Usd4tVZ5hktV01fP6Hy0HbRIeZjopkDuXnleB216W4GqQtcz5eKwC8aP+k iyY350EKe58ojAj6bLgA4SdCT7vkw== X-ME-Sender: X-ME-Proxy: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Fri, 23 Nov 2018 18:02:05 -0500 Message-Id: <20181123230206.12629-4-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181123230206.12629-1-cota@braap.org> References: <20181123230206.12629-1-cota@braap.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.28 Subject: [Qemu-devel] [PATCH 3/4] include: move exec/tb-hash-xx.h to qemu/xxhash.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Emilio G. Cota --- include/exec/tb-hash.h | 2 +- include/{exec/tb-hash-xx.h =3D> qemu/xxhash.h} | 6 +++--- tests/qht-bench.c | 2 +- util/qsp.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) rename include/{exec/tb-hash-xx.h =3D> qemu/xxhash.h} (97%) diff --git a/include/exec/tb-hash.h b/include/exec/tb-hash.h index 731ba4c272..4f3a37d927 100644 --- a/include/exec/tb-hash.h +++ b/include/exec/tb-hash.h @@ -20,7 +20,7 @@ #ifndef EXEC_TB_HASH_H #define EXEC_TB_HASH_H =20 -#include "exec/tb-hash-xx.h" +#include "qemu/xxhash.h" =20 #ifdef CONFIG_SOFTMMU =20 diff --git a/include/exec/tb-hash-xx.h b/include/qemu/xxhash.h similarity index 97% rename from include/exec/tb-hash-xx.h rename to include/qemu/xxhash.h index 98ce4b628a..fe35dde328 100644 --- a/include/exec/tb-hash-xx.h +++ b/include/qemu/xxhash.h @@ -31,8 +31,8 @@ * - xxHash source repository : https://github.com/Cyan4973/xxHash */ =20 -#ifndef EXEC_TB_HASH_XX_H -#define EXEC_TB_HASH_XX_H +#ifndef QEMU_XXHASH_H +#define QEMU_XXHASH_H =20 #include "qemu/bitops.h" =20 @@ -119,4 +119,4 @@ static inline uint32_t qemu_xxhash6(uint64_t ab, uint64= _t cd, uint32_t e, return qemu_xxhash7(ab, cd, e, f, 0); } =20 -#endif /* EXEC_TB_HASH_XX_H */ +#endif /* QEMU_XXHASH_H */ diff --git a/tests/qht-bench.c b/tests/qht-bench.c index 0278f4da04..ab4e708180 100644 --- a/tests/qht-bench.c +++ b/tests/qht-bench.c @@ -9,7 +9,7 @@ #include "qemu/atomic.h" #include "qemu/qht.h" #include "qemu/rcu.h" -#include "exec/tb-hash-xx.h" +#include "qemu/xxhash.h" =20 struct thread_stats { size_t rd; diff --git a/util/qsp.c b/util/qsp.c index dc29c41fde..410f1ba004 100644 --- a/util/qsp.c +++ b/util/qsp.c @@ -61,7 +61,7 @@ #include "qemu/timer.h" #include "qemu/qht.h" #include "qemu/rcu.h" -#include "exec/tb-hash-xx.h" +#include "qemu/xxhash.h" =20 enum QSPType { QSP_MUTEX, --=20 2.17.1 From nobody Fri May 3 14:14:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1543014253871811.491953191049; Fri, 23 Nov 2018 15:04:13 -0800 (PST) Received: from localhost ([::1]:54523 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQKUX-0000zu-SR for importer@patchew.org; Fri, 23 Nov 2018 18:04:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQKSr-0007hD-AH for qemu-devel@nongnu.org; Fri, 23 Nov 2018 18:02:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQKSo-000294-3a for qemu-devel@nongnu.org; Fri, 23 Nov 2018 18:02:21 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:60245) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gQKSn-00025c-N1 for qemu-devel@nongnu.org; Fri, 23 Nov 2018 18:02:17 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 60B9B21FB2; Fri, 23 Nov 2018 18:02:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 23 Nov 2018 18:02:17 -0500 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 166CC102F0; Fri, 23 Nov 2018 18:02:17 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h= from:to:cc:subject:date:message-id:in-reply-to:references; s= mesmtp; bh=g/8u82naiqG+ptLtnie9KJ2nVzpSc5Vui7bQArLLK30=; b=02awu LK/n9bEv1GYzxuvksk8KDcWo6M0I0b+nR9ssYugYcLkc8VwRQKJe41mjDJmQGNyM gBoSEhpG1TbcODj4jQUP9LN0WHzSfOL6ou7JeBpOY1NZo7gp8/9ZeWDn7ym9MZaD FNNAeN2dxGVgoUomb2JTHeR8kyuJORzOZEnkqc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=g/8u82naiqG+ptLtnie9KJ2nVzpSc 5Vui7bQArLLK30=; b=EnOSgT+GIJcrKplZBzKKbMUevtJoD4u2BKyXEkrO9OhiD +YFXB3jSn493TQA7veWv4+huvGqNuiPdb/GUfQFzKsMYsm4hXfVbCPN7M25tJ4d1 qIkC2+r5aUPPCVtKdwJxlz4hga0WDmdzwuHsOpDnD69LQYjzoLsEw8NgSRndfhVQ 9yG+aXPUg0cAsmMFDFfwGzQ904l/z8y9aN9PcugFErbo6aNVkhVQt8bokYy/YdxP 8gHxxcmV3TzRV/GXwnHxHqVbJRD6qcU6EGJkEYvF5ACkmXqbtZZRyLoWTFb7nVtL /1dAtlDpO8wsRadxIZTst76El/AWIjc50rDto9sEg== X-ME-Sender: X-ME-Proxy: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Fri, 23 Nov 2018 18:02:06 -0500 Message-Id: <20181123230206.12629-5-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181123230206.12629-1-cota@braap.org> References: <20181123230206.12629-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.28 Subject: [Qemu-devel] [PATCH 4/4] xxhash: match output against the original xxhash32 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Alex Benn=C3=A9e Tested-by: Alex Benn=C3=A9e --- 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, uint= 32_t f, uint32_t g) uint32_t v2 =3D QEMU_XXHASH_SEED + PRIME32_2; uint32_t v3 =3D QEMU_XXHASH_SEED + 0; uint32_t v4 =3D QEMU_XXHASH_SEED - PRIME32_1; - uint32_t a =3D ab >> 32; - uint32_t b =3D ab; - uint32_t c =3D cd >> 32; - uint32_t d =3D cd; + uint32_t a =3D ab; + uint32_t b =3D ab >> 32; + uint32_t c =3D cd; + uint32_t d =3D cd >> 32; uint32_t h32; =20 v1 +=3D a * PRIME32_2; --=20 2.17.1