From patchwork Wed Oct 27 02:43:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 46680 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 03CB53857C63 for ; Wed, 27 Oct 2021 02:44:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03CB53857C63 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1635302678; bh=r3lQjPYB984qltOWRQoUzSUVgxS0MsINEFiI/inEOZk=; 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=oeIGyd2s/7wjKLe04D1a8BMN+pwr+JWSgjzpkvjqDUuZiKLBNydCBIPjmugI74rfk FtUOI4wKHUJgBgmi8JaYqgwz0UoZ18dLFvXDzm4iLHFNwOocoTu1JtkyU/H8IOYCAN VQwCkmEa5r+OV/ENop4l7zmvsLIictilbTL9RdSY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) by sourceware.org (Postfix) with ESMTPS id 8C0AE3858405 for ; Wed, 27 Oct 2021 02:43:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8C0AE3858405 Received: by mail-il1-x12c.google.com with SMTP id w10so1345976ilc.13 for ; Tue, 26 Oct 2021 19:43:35 -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=r3lQjPYB984qltOWRQoUzSUVgxS0MsINEFiI/inEOZk=; b=emZj+RUwAsVjC4oDNX6sDZt5hwYnPni7zNmHhyzlFUlFvtdJpNe08c956O7Kim837r aw0E3fMN+N8UOl4NC7xCTchRS4OWhP0lwZGRsl5qnfo8uo9WEjGgqUGm3nXwFwq17hWL 8InLNVqlzfxzVTAMXYqV3QWG+mMOYDHKiIlUmFAeR7ESP6EPaP8dK0PYgLRDnxmuenpu 9ar9aC0ffQL8mPDQGRtF5sAwK/LyQpdbYWaCfRjpwQgQy2oeE6br+5oRDIrUIXzvoAyY 8eE3Z2ba4FzP0d8gAlVBZvGpTv+SHqctxPOzX0BXWE6ZFao8gJSjV0/he2SyN5Dn21T3 jACw== X-Gm-Message-State: AOAM533QaMebcV58yGnvMWVB76kOX8APMi6aY3Bhefe9ZYZ4uxqReAYw 2A90vyXS6exoTqxp6RexaqgoFmikGWk= X-Google-Smtp-Source: ABdhPJz6VMVKDHsRri+Z13kOuZER1bF20yCZ+SRg6ni6PyDmX2v//vcrMPHKUVN+KvV3O5DsFQsMsg== X-Received: by 2002:a92:cda5:: with SMTP id g5mr9291440ild.36.1635302614806; Tue, 26 Oct 2021 19:43:34 -0700 (PDT) Received: from localhost.localdomain (mobile-130-126-255-38.near.illinois.edu. [130.126.255.38]) by smtp.googlemail.com with ESMTPSA id l6sm12215373ilt.31.2021.10.26.19.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 19:43:34 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v1 2/6] Benchtests: Add benchtests for __memcmpeq Date: Tue, 26 Oct 2021 21:43:19 -0500 Message-Id: <20211027024323.1199441-2-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211027024323.1199441-1-goldstein.w.n@gmail.com> References: <20211027024323.1199441-1-goldstein.w.n@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-Patchwork-Original-From: Noah Goldstein via Libc-alpha From: Noah Goldstein Reply-To: Noah Goldstein Errors-To: libc-alpha-bounces+patchwork=sourceware.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 | 4 +++- benchtests/bench-memcmpeq.c | 20 ++++++++++++++++++++ 3 files changed, 24 insertions(+), 2 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..546b06e1ab 100644 --- a/benchtests/bench-memcmp.c +++ b/benchtests/bench-memcmp.c @@ -17,7 +17,9 @@ . */ #define TEST_MAIN -#ifdef WIDE +#ifdef TEST_MEMCMPEQ +# define TEST_NAME "__memcmpeq" +#elif defined WIDE # define TEST_NAME "wmemcmp" #else # define TEST_NAME "memcmp" 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"