From patchwork Thu Apr 20 15:00:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 675629 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp365258wrs; Thu, 20 Apr 2023 08:02:34 -0700 (PDT) X-Google-Smtp-Source: AKy350aySshSpQekKVuqFivm+wldjzow5qB7FeLd/NgekjgEk5/yisyXOju8X2vrwzbrkfPr2ESG X-Received: by 2002:a7b:c388:0:b0:3f1:6fea:790a with SMTP id s8-20020a7bc388000000b003f16fea790amr1501158wmj.30.1682002954492; Thu, 20 Apr 2023 08:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682002954; cv=none; d=google.com; s=arc-20160816; b=UaVC5aQdjqgLgUFs4JKqCFx5DCKNtoB85i0lSPVQcr/LCsrZ3KdXDteOjPnNEPlg1X ftjbmEC/+anBBS+Twk8C3dDq7x1MUXOunT8sob9RTxgx9l0XhX1pSLfn20NN/NpqwB4o 5xTbxLVhjIRlqFNtlPp58p5RBfQYD0tXhKtotzgPwNO3pnazd/WAk+CszIiVurH5vgRn sotQy4UU2fSce9PMHgwxCj/jc0rjV9LA3B24k3fRtwHQq8hZDL4jfRgRXjifSZSu/Sps QTiioWC9rqYOw0m6fAOChMZO6iuN2ZnjotdfEpH4TVr0Bt4vg+BlPlrv88lLOgxQ/2EQ X43Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2mUGdFeLesXixgZdR4dkifVgmw89yr/nJqMOkP0ydlI=; b=sXTt1/iIQnhGA+FZ1Lei+Q5M+M1e6HDo+Brs8hUvAGN+BonB8zdV+7MK7bI4pk9jeB Fi9Eh18s2FpojoAQkxzf7shUeeLM4zPAKWy7Yl+Cp9fNj+nkiw5uos6Zp1OJN91Yk4Bk DcmC7eHvFWyLJQUFxV/afGYG/TIVV2wRpCBRY3Q/IujyvBpaajA4GdcUxApL9fvRyHjR B0Phr5po+KlSjSEVDzxn1M2i/ZTdZ4FSK7p1iYFAaVS+UrI7T2vLqkL99etrdH7PEOtU 6wcZqC6htWYkhPqHZFashD3huzrx4TrEACCuK2d+C1Mp/zMLwdS/sXkM69AaO0b77apX JLGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q9YAuYXc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s15-20020adfea8f000000b002efb527f487si1569843wrm.591.2023.04.20.08.02.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Apr 2023 08:02:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q9YAuYXc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppVls-0003qM-Vk; Thu, 20 Apr 2023 11:00:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppVlk-0003dA-71 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:21 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppVlg-00047W-I6 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:19 -0400 Received: by mail-wm1-x32f.google.com with SMTP id he11-20020a05600c540b00b003ef6d684102so3204490wmb.3 for ; Thu, 20 Apr 2023 08:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682002815; x=1684594815; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2mUGdFeLesXixgZdR4dkifVgmw89yr/nJqMOkP0ydlI=; b=Q9YAuYXcSydEZ7VVlWXZMKct4mjUM6fD40au3zTtI88VlqrXmktxXyF5zg3P0Sko0v SNapRdEd4veuK0oeO42R0L2zc+qLnqvIiPU3tv5L68CRJLQBMSyHD7iYP1sJLpPPIgF7 W0ce3WLYbAdNQX15apEycgNs3ACmGZZkz8mquxW+Eec4kMRZRtxnhX/uYpdGEu4Oqzqv dWLupWIAIPHWIQd/Ug2EzV+uxkMzK0iG5FmdMg3StR1BQU+XTf34jt6kiDATxjDshs+k bTZJVyUqhe6Om+VmPErVOVBToY5RPm6EyzCBgQtVDsdij8f+zeQ25s0H7SqWGj4PK5W7 ohIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682002815; x=1684594815; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2mUGdFeLesXixgZdR4dkifVgmw89yr/nJqMOkP0ydlI=; b=RpCQgy4/NXx0jZzYHXBmbHiJpXWcvdL+ikBJlGHrSZ/sZMgSVo7RbysyCa1OSHAOb/ yl+UGLcd3notU7VBJUGWmrZK0vSSbXcqvDuOlThXXGkbebcd7VZ2T1knl2hswjT/dIOv EsxAjpboiNxekh4ED8YgmuW+LKjEOLlApIf7TwUGoX+kxT2owvKWX++59OIjKyUgXQRs ULKOeVH0zcJxzyf/yaRBBeIJq2j+basJoGg1czZiVJWDGh7P6LIxakZca70kC+SlLTzY 80XG11H/MBU1jeBMAQaZBSWrJvGqiv0ezTrXd85UbcqVjo0ubgMe0JRdWityBf8OTvLz obWw== X-Gm-Message-State: AAQBX9elbEpfzPWYSqZ2yfeggxPG8PG25UBPvQM8+XWw23UmpBfUOdGV BvgMPPNoY5+GKBOdxD8/510FOA== X-Received: by 2002:a1c:7916:0:b0:3f1:72dc:8bae with SMTP id l22-20020a1c7916000000b003f172dc8baemr1625459wme.21.1682002815004; Thu, 20 Apr 2023 08:00:15 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id r3-20020a05600c35c300b003f1836c98b7sm3334870wmq.48.2023.04.20.08.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 08:00:13 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 428B31FFC0; Thu, 20 Apr 2023 16:00:11 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Michael Roth , Riku Voipio , Christian Schoenebeck , Yanan Wang , Greg Kurz , Richard Henderson , Kyle Evans , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Stefan Hajnoczi , Eric Blake , Markus Armbruster , Warner Losh , Paolo Bonzini , Marcel Apfelbaum , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 10/10] xxhash: remove qemu_xxhash7 Date: Thu, 20 Apr 2023 16:00:09 +0100 Message-Id: <20230420150009.1675181-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420150009.1675181-1-alex.bennee@linaro.org> References: <20230420150009.1675181-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 Reviewed-by: Philippe Mathieu-Daudé --- 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); } /*