From nobody Tue Nov 26 12:34:58 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1707984971; cv=none; d=zohomail.com; s=zohoarc; b=FoNzK8/OOQCykv3bReYr6SUOiMxjiu1h7coaVr6ycVcAz+eYOp9zJGM41XmlkOqLWLpIqV//Wwa3UisyMMuO0YulV2X0GePcHBRVHkAvRkokLgDNbxr/yUhV6oCl+fICOLCMkUBTqwCTQxDpraw1f1A7SO47cJIPlaxrZ2tlMTs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707984971; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+5kI9i1T4g1qlGS3lxQuuu2LwuYBA3jGXjmyocvfHSc=; b=bUcfFSDX5l+0YWLOcHFCVO1gjrmohj4WDSYEDlNfq92RN9CBG/e3J7By9WIrpJWrn9vTjSWzgK1GAVDdaqAo+oZU+IcAtC/LrCbCW/55gGWvxE9XeaodzGp+Ktx1+jGvlfm1LG/rJZE08TvcPt/LdgE+1IYwZrT0gt7AW9wZG7w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1707984971794789.5464841144177; Thu, 15 Feb 2024 00:16:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1raWu9-0007hR-FJ; Thu, 15 Feb 2024 03:15:37 -0500 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 1raWtb-0007Cj-PI for qemu-devel@nongnu.org; Thu, 15 Feb 2024 03:15:06 -0500 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raWta-0001PV-4M for qemu-devel@nongnu.org; Thu, 15 Feb 2024 03:15:03 -0500 Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3bd72353d9fso450614b6e.3 for ; Thu, 15 Feb 2024 00:15:01 -0800 (PST) Received: from stoup.. (173-197-098-125.biz.spectrum.com. [173.197.98.125]) by smtp.gmail.com with ESMTPSA id qc14-20020a17090b288e00b0029900404e11sm807755pjb.27.2024.02.15.00.14.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 00:15:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707984901; x=1708589701; darn=nongnu.org; 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=+5kI9i1T4g1qlGS3lxQuuu2LwuYBA3jGXjmyocvfHSc=; b=bNRaOfVoxaup6DdFdTBI/FTE4rnKVKD2x3aHfXpQhC27t5Jx2az7s5ItLAPAgIEzX8 6sJqvvCDt5CL4dy2fVO4u07hvcl46scWgIpf/C4EyuQbguJYuFTRfn/qSErW7Q8LQKao +g4M7i3lx4kwgBFu0J84mml2mGOSWuECZ4KOZCU28e1FGPfRH4KB5vvRP/9IGBE2M27L OLYMANsL3K92mW96tqQ7flgZEaa6/595TFE0h8T/r2AuzBW7lwN+0e0KrZwZ/BnVWiWi O/ecElTi+IgIVpb6SO374SWqyzPIbCbXNrj9B+paPiXwAeZaYhJKExq2CORN+vRCLECW n1ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707984901; x=1708589701; 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=+5kI9i1T4g1qlGS3lxQuuu2LwuYBA3jGXjmyocvfHSc=; b=BFdBjqY3S9MFjoG3RHS/+nHQLXGFRG0ONzh6g3ITFLW4FRkjJWu9X6qn2RSorKJ1Yv Wx/H6PRwezTfWxDeRxebi0u1g6FrdRJQWVzI4ny8nVvGlL9+codVzQ3AFQa+gT1uJtks 8MPgtw3HViFH7/geq23W6AwgG+AbWH47EuYF9yDdTEDFamFK/LmYIOWWRPROWbdemdzA lv4eh2rd9/UhVVc2El7wKAMKlN/BH+6klfG+EH8U/DiRgVOGdPkTP1sQXPKq8eAWxym0 2hQW8NRzSgIpJ8mvridmUt/5yih1nPPfHYxhnEdLQhcnAmGi0VsTjGBSRWvd2FThGTX/ ehtw== X-Gm-Message-State: AOJu0YzCLFSy2M2tmZDrEBNToLX6TPICHE/AQAIWz/LkcgwVe1qJqaas 0tRGXGGmZwe7H+xCtf7y36DsZclWBsttabXW4LkVyHdAlInldPza3Wsf9pVF7w07o9+TfH1Yi2f A X-Google-Smtp-Source: AGHT+IF9spF03LMpTCCog7Hsal4zoowWZXji4owaG+gTb7KneARWWa/QnD0bTLE0Nim9dq/y/BWhIQ== X-Received: by 2002:a05:6358:6f0b:b0:178:688e:fb21 with SMTP id r11-20020a0563586f0b00b00178688efb21mr1068454rwn.7.1707984901019; Thu, 15 Feb 2024 00:15:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: amonakov@ispras.ru, mmromanov@ispras.ru Subject: [PATCH v4 07/10] util/bufferiszero: Introduce biz_accel_fn typedef Date: Wed, 14 Feb 2024 22:14:46 -1000 Message-Id: <20240215081449.848220-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240215081449.848220-1-richard.henderson@linaro.org> References: <20240215081449.848220-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::22b; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1707984973712100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- util/bufferiszero.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/util/bufferiszero.c b/util/bufferiszero.c index ce04642c67..ce80713071 100644 --- a/util/bufferiszero.c +++ b/util/bufferiszero.c @@ -26,7 +26,8 @@ #include "qemu/bswap.h" #include "host/cpuinfo.h" =20 -static bool (*buffer_is_zero_accel)(const void *, size_t); +typedef bool (*biz_accel_fn)(const void *, size_t); +static biz_accel_fn buffer_is_zero_accel; =20 static bool buffer_is_zero_int_lt256(const void *buf, size_t len) { @@ -179,13 +180,15 @@ buffer_zero_avx2(const void *buf, size_t len) } #endif /* CONFIG_AVX2_OPT */ =20 + + static unsigned __attribute__((noinline)) select_accel_cpuinfo(unsigned info) { /* Array is sorted in order of algorithm preference. */ static const struct { unsigned bit; - bool (*fn)(const void *, size_t); + biz_accel_fn fn; } all[] =3D { #ifdef CONFIG_AVX2_OPT { CPUINFO_AVX2, buffer_zero_avx2 }, @@ -232,7 +235,7 @@ bool test_buffer_is_zero_next_accel(void) #define INIT_ACCEL buffer_is_zero_int_ge256 #endif =20 -static bool (*buffer_is_zero_accel)(const void *, size_t) =3D INIT_ACCEL; +static biz_accel_fn buffer_is_zero_accel =3D INIT_ACCEL; =20 static inline bool buffer_is_zero_sample3(const char *buf, size_t len) { --=20 2.34.1