From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, PDS_RDNS_DYNAMIC_FP,RCVD_IN_DNSWL_HI,RDNS_DYNAMIC,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 4ED151F953 for ; Wed, 27 Oct 2021 16:08:12 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E7B2F3857803 for ; Wed, 27 Oct 2021 16:08:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E7B2F3857803 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1635350890; bh=VIp85XyxCq+ISKYV6yGjLeqAk6D3AEdslba7Va4plXM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=qKOphgD0pTjalsGtJSfGdi4rnl8W+xJsKb0rlJHZJpyGVF2z1mSHYTDwTWuVJ/9N1 UZqKbqT/Mk6clHDO9hS9KuwBySSF726fwQaUAlRAuLEiNnvte/TJgncFENgqcdZLb+ iTeyRVb1M6RQSGBWdVyoUYEeY5EIkp7sl9w6EhYE= Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) by sourceware.org (Postfix) with ESMTPS id 7AED23857800 for ; Wed, 27 Oct 2021 16:07:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7AED23857800 Received: by mail-il1-x134.google.com with SMTP id 3so3490075ilq.7 for ; Wed, 27 Oct 2021 09:07:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VIp85XyxCq+ISKYV6yGjLeqAk6D3AEdslba7Va4plXM=; b=hUlPT+3NBI7qPi8uA9/ccjNFCThWYl1tyFWdfH3ZVnhLEjD9LzJADp8NpeGaIeSfDq E/mbyYIsbVnT01b9XriCcU2aU8WGmgaSb1kauKec9kwIEzPjCGK0pKGLuJ1KZ9EkI/Fk lVihslgh8/TyJ2v7JC84VK5X4tf1lpbyautjwYGcvQO/IETYICnzyVOeQi0OzCM+2PBS gvA2w0Tq9KCQEAL04tF8O1KDxJXK7MDrmpSIm312Qtd+1bdrLeTCU3H79TFOxZkuynT9 hcRxSEJwhVU5cZzYJhEMePpcs3Q5c6ydaWsn5QhkgzsQS3slwxEEFSaFH0ZCtJB5VABX EbKg== X-Gm-Message-State: AOAM5302Iy5rOgjiPpLMRUCjlJwyUmVfvCJfrUShO+0uo7kJVaap3ToK cNxbSoNQKGKF9d9Yy84f5Cptz7Eo+nY= X-Google-Smtp-Source: ABdhPJwKEJLpOIscElgBg2ZRzoImbzpAH9ybOM4ukSzn8IS1BUPw8XjTPKoqOaD6RNw8KXN82amIKA== X-Received: by 2002:a05:6e02:1c89:: with SMTP id w9mr12099458ill.189.1635350867694; Wed, 27 Oct 2021 09:07:47 -0700 (PDT) Received: from localhost.localdomain ([2600:1008:b008:ef4c:c2c8:d0b2:872f:235b]) by smtp.googlemail.com with ESMTPSA id v26sm148670iox.35.2021.10.27.09.07.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Oct 2021 09:07:47 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v2 2/6] Benchtests: Add benchtests for __memcmpeq Date: Wed, 27 Oct 2021 11:07:37 -0500 Message-Id: <20211027160737.1987445-1-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211027024323.1199441-2-goldstein.w.n@gmail.com> References: <20211027024323.1199441-2-goldstein.w.n@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Noah Goldstein via Libc-alpha Reply-To: Noah Goldstein Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" No bug. This commit adds __memcmpeq benchmarks. The benchmarks just use the existing ones in memcmp. This will be useful for testing implementations of __memcmpeq that do not just alias memcmp. --- benchtests/Makefile | 2 +- benchtests/bench-memcmp.c | 14 ++++++++------ benchtests/bench-memcmpeq.c | 20 ++++++++++++++++++++ 3 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 benchtests/bench-memcmpeq.c diff --git a/benchtests/Makefile b/benchtests/Makefile index b690aaf65b..7be0e47c47 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -103,7 +103,7 @@ bench := $(foreach B,$(filter bench-%,${BENCHSET}), ${${B}}) endif # String function benchmarks. -string-benchset := memccpy memchr memcmp memcpy memmem memmove \ +string-benchset := memccpy memchr memcmp memcmpeq memcpy memmem memmove \ mempcpy memset rawmemchr stpcpy stpncpy strcasecmp strcasestr \ strcat strchr strchrnul strcmp strcpy strcspn strlen \ strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ diff --git a/benchtests/bench-memcmp.c b/benchtests/bench-memcmp.c index 0d6a93bf29..2cf65525bb 100644 --- a/benchtests/bench-memcmp.c +++ b/benchtests/bench-memcmp.c @@ -17,17 +17,21 @@ . */ #define TEST_MAIN -#ifdef WIDE +#ifdef TEST_MEMCMPEQ +# define TEST_NAME "__memcmpeq" +# define SIMPLE_MEMCMP simple_memcmpeq +#elif defined WIDE # define TEST_NAME "wmemcmp" +# define SIMPLE_MEMCMP simple_wmemcmp #else # define TEST_NAME "memcmp" +# define SIMPLE_MEMCMP simple_memcmp #endif #include "bench-string.h" #ifdef WIDE -# define SIMPLE_MEMCMP simple_wmemcmp int -simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n) +SIMPLE_MEMCMP (const wchar_t *s1, const wchar_t *s2, size_t n) { int ret = 0; /* Warning! @@ -40,10 +44,8 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n) #else # include -# define SIMPLE_MEMCMP simple_memcmp - int -simple_memcmp (const char *s1, const char *s2, size_t n) +SIMPLE_MEMCMP (const char *s1, const char *s2, size_t n) { int ret = 0; diff --git a/benchtests/bench-memcmpeq.c b/benchtests/bench-memcmpeq.c new file mode 100644 index 0000000000..e918d4f77c --- /dev/null +++ b/benchtests/bench-memcmpeq.c @@ -0,0 +1,20 @@ +/* Measure __memcmpeq functions. + Copyright (C) 2015-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#define TEST_MEMCMPEQ 1 +#include "bench-memcmp.c" -- 2.25.1