From patchwork Fri May 3 15:13:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 794383 Delivered-To: patch@linaro.org Received: by 2002:adf:a153:0:b0:34d:5089:5a9e with SMTP id r19csp788543wrr; Fri, 3 May 2024 08:14:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWaDfZiJBZ1/DkOjNXV9xQkwjy5DsSgvVB+UGOwBZyUXz+ngr6YgkPh7ymK5wVGsENk/gvIruTLMRFMsKTq1nH/ X-Google-Smtp-Source: AGHT+IFcNnNG4HUJlZTWJmf/6r7cT97fMQGp88Bk6si8rmkhtZs+3S+lnusrHJMgAZ6hv33se37n X-Received: by 2002:a05:6870:5d88:b0:222:7000:8b28 with SMTP id fu8-20020a0568705d8800b0022270008b28mr3427954oab.32.1714749239766; Fri, 03 May 2024 08:13:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714749239; cv=none; d=google.com; s=arc-20160816; b=z7K6oUXcH2sKHSlM8Y6KDp7tnmjP1e86rUm1IqTvK+5fMEL9kvIwveDAKHu78gdgCW bxKCsviaW9uk3ayPOE3DFBjz/605tdRy0HOwGwg0gTZKnIf2WF2SBU723ZwOa+qO+8cu v6scBm/ry42fX4JRMefBlw8g2HkpH4xkJjSQkjihRCAmjJOguEzGn4ijwraxfumqWiRF v6WAP9ZfXZSBmEhEZErY9lfE6I/5dtpGEuhnwgrX3JZ6jSxZ+n+TLHMPCgRUomFF+gTF mzx2KvtA6vEqOqxsLzrUtAuNHr2tGLNUC/pzIioha0JDkbqS5+xgCi+ONgJd/qk68Jj3 uZpg== 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=oO6lVL+LVK6xULV3eqZmGPXjUDThyU0i78qX8xOIR9w=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=RLJ2ieB5vTJXxK4EZibasmwLvzJZnj70qg7+SyKSa+UlIvYXaADMk9MjjmFvwKVQuG eqggp/lbxxV8YPANCeWuL0zSBdEx++c90yG7ZsycycA2lDds+370+wrEeW2GUKvAr+4s 3OwnuKrYJLwfYorMRen8ksEbor1DLOLBNNJ/pelJX43OD0qtNXil5yFCa1Y9/h037QlM SAVbRkQBYNOd7cG2TvXlNOUXD+Meceuapu7V7w4VtSG1EtBleohck2+zlS/QcmgO+0yC BGlCebrQiiyLhaePfBLGOF3e5QE6FyfCLdSwnXqZu46R5FUC+WJ99qfpZGTVpjE0GFk4 hBGQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Hwj/a+k2"; 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 o21-20020a05620a229500b007906a37c7a2si3174044qkh.343.2024.05.03.08.13.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2024 08:13:59 -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="Hwj/a+k2"; 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 1s2ubJ-0005nR-1I; Fri, 03 May 2024 11:13: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 1s2ubG-0005kb-72 for qemu-devel@nongnu.org; Fri, 03 May 2024 11:13:26 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s2ubE-00076G-Jz for qemu-devel@nongnu.org; Fri, 03 May 2024 11:13:25 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1ec69e3dbcfso34037485ad.0 for ; Fri, 03 May 2024 08:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714749202; x=1715354002; 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=oO6lVL+LVK6xULV3eqZmGPXjUDThyU0i78qX8xOIR9w=; b=Hwj/a+k2/t2qsCutDjeU8sVsgHzlmzSNdDJTFESksbdthyTduPeEu571hUjxcqAuFw fFoBy1v5DWJvrvWX8Fu8tpa0h/TOfugqdI7CQxHhviRLn4ZSSPsi79zvx90FQKRicrJm fdAaG/+MPFrN68BIy0UmEmRR23EMlglTUpnpci05rrAeMgNt2e7+gx/339MVcqciJbHf LvGFh6gK8d8trMCWYSfxn42Z740sLSH0WSwCZzxMP4Z7N7vmD+EsuIVERUammMaOALvG dmrOKosXP1D6o2sMNFWm4KNwZSqAiiF5A0UBe936aUTfx1kSZYUPLWZuDqFKXO8CTZdm hfDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714749202; x=1715354002; 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=oO6lVL+LVK6xULV3eqZmGPXjUDThyU0i78qX8xOIR9w=; b=VPK3Mkgd1FuU4keuHpngLV21NUEBA9PM0EEbQD6i4ltiJQj5pmiwSyleQCRIEotA/D NmfKmBV6WGuAxYKGYsdPRK2TspZwsP6nUEFq61IvnE8Bt9OK5bqN/T9qYHe6LjHaY9JJ eD4PEGcAWD65iUMG+5UwPL2rtKOGjWq9JTAeWUyt/BkJVIWUPFI4+IW/aPXdLo+S7sLe S3cnPQu8GldkddsWdUZ/mP2udLnIwWNu1oqI6AE2jGPgQTGnHAEhc6uB6NesdMOlfxFi GVG7Cht3HRAp6lTCoysTq00aqQcdwLGsh632gALw1dygx0khf4mmkqx43qX0c0PKk+NN XHRg== X-Gm-Message-State: AOJu0YwssLnMLUElOdsjvx8AXh4fjrPo94dlY6FwvotBWxm0Cmt5teep uQ73zBQj+qrvm3Qlit9pDUtmfFmp6dIQ9d1RBqxUEsxETLK9si5L39L+jqmzccA/nIK0OIdzP6E w X-Received: by 2002:a17:902:da8d:b0:1e5:2883:6ff6 with SMTP id j13-20020a170902da8d00b001e528836ff6mr3582685plx.11.1714749202614; Fri, 03 May 2024 08:13:22 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id p10-20020a170902c70a00b001e81c778784sm3366611plp.67.2024.05.03.08.13.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 08:13:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 07/10] util/bufferiszero: Introduce biz_accel_fn typedef Date: Fri, 3 May 2024 08:13:11 -0700 Message-Id: <20240503151314.336357-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240503151314.336357-1-richard.henderson@linaro.org> References: <20240503151314.336357-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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 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 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- util/bufferiszero.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/util/bufferiszero.c b/util/bufferiszero.c index c9a7ded016..f9af7841ba 100644 --- a/util/bufferiszero.c +++ b/util/bufferiszero.c @@ -26,7 +26,8 @@ #include "qemu/bswap.h" #include "host/cpuinfo.h" -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; static bool buffer_is_zero_int_lt256(const void *buf, size_t len) { @@ -184,7 +185,7 @@ 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[] = { #ifdef CONFIG_AVX2_OPT { CPUINFO_AVX2, buffer_zero_avx2 }, @@ -231,7 +232,7 @@ bool test_buffer_is_zero_next_accel(void) #define INIT_ACCEL buffer_is_zero_int_ge256 #endif -static bool (*buffer_is_zero_accel)(const void *, size_t) = INIT_ACCEL; +static biz_accel_fn buffer_is_zero_accel = INIT_ACCEL; bool buffer_is_zero_ool(const void *buf, size_t len) {