Message ID | 20230201170406.303978-22-adhemerval.zanella@linaro.org |
---|---|
State | Superseded |
Headers |
Return-Path: <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> 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 2EB48389EC69 for <patchwork@sourceware.org>; Wed, 1 Feb 2023 17:06:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2EB48389EC69 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675271207; bh=mCE/YFqXL4Z7i4zGFW/a0I/C1EeOtkop6T1+5F6jnvE=; 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=M5PUCy+ZlpQN2AMZ6TqUQNxS7SADcKLcDo8c0XUJMohqys+bVyl8uWBuJzcN06PmU vBOWJ09iJkr1psIYBpuNBc8ExDn2OCNiXweqM8Z/RuEqRvyKmX+FiMKHVuwRUelOlo 6dMeaPvnZeSC7ACD8GEvEuIVm90+WIrSha4TJrsk= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id 64B9D384A04C for <libc-alpha@sourceware.org>; Wed, 1 Feb 2023 17:05:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 64B9D384A04C Received: by mail-ot1-x32d.google.com with SMTP id e12-20020a0568301e4c00b0068bc93e7e34so3545443otj.4 for <libc-alpha@sourceware.org>; Wed, 01 Feb 2023 09:05:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mCE/YFqXL4Z7i4zGFW/a0I/C1EeOtkop6T1+5F6jnvE=; b=WoMzeCHriR+/xrOsylZELqlhYXdNssZLbECKcZBJoDbhVfBpi1yH4hNYUoHsl4q7pq PyL6lb6nVfFepubfh8hTTAzPbNO6UamA88dJ1pZHwL0982SWp3EWWSUCGw0qsw5pnMVp 47UuXo1cfYZdAS7IYPPC6kRZUSHM6Oshe4LlO/razwm0o/TilmExn3hVS5MlGNs5DWEt qabDPicBaMLuhAbZsPBLdmcZjf9oGmyB5PQzqAwiUhPfu1UWnItLmzjH7w7ZiL64q6KP ms4PiNeQELQlJ2NDLMMamD5c/2yl01YNEM7M2qjQM+tZt/jmUQzzf32BcULsfyyDogqv 2Ftg== X-Gm-Message-State: AO0yUKUs2SsMywf7eMqGZ+Cte4zPkF37M9snMZB2briK/JzUjxSQFJGY wP8QGDUoS39dnCFUf+N7e4QyycufHGUAEtIu3r4= X-Google-Smtp-Source: AK7set+WxXtp/k3L0giFKOmwtsmMPhWyRZnCjWJE/6BsBnUtbhrReu/YsFmpy/3bWEfWctDi7h2w4A== X-Received: by 2002:a05:6830:3090:b0:68d:3fc8:7c09 with SMTP id g16-20020a056830309000b0068d3fc87c09mr937501ots.4.1675271106056; Wed, 01 Feb 2023 09:05:06 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c2:1887:d2ed:98c2:d2cc:bf06]) by smtp.gmail.com with ESMTPSA id b17-20020a056830311100b006863ccbf067sm8077090ots.74.2023.02.01.09.05.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 09:05:05 -0800 (PST) To: libc-alpha@sourceware.org, Richard Henderson <richard.henderson@linaro.org>, Noah Goldstein <goldstein.w.n@gmail.com>, Jeff Law <jeffreyalaw@gmail.com>, Xi Ruoyao <xry111@xry111.site> Subject: [PATCH v11 21/29] string: Hook up the default implementation on test-strlen Date: Wed, 1 Feb 2023 14:03:58 -0300 Message-Id: <20230201170406.303978-22-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230201170406.303978-1-adhemerval.zanella@linaro.org> References: <20230201170406.303978-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Adhemerval Zanella <adhemerval.zanella@linaro.org> Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Improve generic string routines
|
|
Checks
Context | Check | Description |
---|---|---|
dj/TryBot-apply_patch | success | Patch applied to master at the time it was sent |
Commit Message
Adhemerval Zanella Netto
Feb. 1, 2023, 5:03 p.m. UTC
Also remove the simple_STRLEN and builtin_strlen, which are not used anywhere. --- string/test-strlen.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-)
Comments
On 2/1/23 07:03, Adhemerval Zanella wrote: > Also remove the simple_STRLEN and builtin_strlen, which are not used > anywhere. > --- > string/test-strlen.c | 31 ++++++++++++++----------------- > 1 file changed, 14 insertions(+), 17 deletions(-) Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~ > > diff --git a/string/test-strlen.c b/string/test-strlen.c > index 81adf23737..0f98576f40 100644 > --- a/string/test-strlen.c > +++ b/string/test-strlen.c > @@ -37,27 +37,24 @@ > > typedef size_t (*proto_t) (const CHAR *); > > -/* Naive implementation to verify results. */ > -size_t > -simple_STRLEN (const CHAR *s) > -{ > - const CHAR *p; > - > - for (p = s; *p; ++p); > - return p - s; > -} > +IMPL (STRLEN, 1) > > +/* Also check the generic implementation. */ > +#undef STRLEN > +#undef weak_alias > +#define weak_alias(a, b) > +#undef libc_hidden_builtin_def > +#define libc_hidden_builtin_def(a) > #ifndef WIDE > -size_t > -builtin_strlen (const CHAR *p) > -{ > - return __builtin_strlen (p); > -} > -IMPL (builtin_strlen, 0) > +# define STRLEN __strlen_default > +# include "string/strlen.c" > +IMPL (__strlen_default, 1) > +#else > +# define WCSLEN __wcslen_default > +# include "wcsmbs/wcslen.c" > +IMPL (__wcslen_default, 1) > #endif > > -IMPL (STRLEN, 1) > - > > static void > do_one_test (impl_t *impl, const CHAR *s, size_t exp_len)
diff --git a/string/test-strlen.c b/string/test-strlen.c index 81adf23737..0f98576f40 100644 --- a/string/test-strlen.c +++ b/string/test-strlen.c @@ -37,27 +37,24 @@ typedef size_t (*proto_t) (const CHAR *); -/* Naive implementation to verify results. */ -size_t -simple_STRLEN (const CHAR *s) -{ - const CHAR *p; - - for (p = s; *p; ++p); - return p - s; -} +IMPL (STRLEN, 1) +/* Also check the generic implementation. */ +#undef STRLEN +#undef weak_alias +#define weak_alias(a, b) +#undef libc_hidden_builtin_def +#define libc_hidden_builtin_def(a) #ifndef WIDE -size_t -builtin_strlen (const CHAR *p) -{ - return __builtin_strlen (p); -} -IMPL (builtin_strlen, 0) +# define STRLEN __strlen_default +# include "string/strlen.c" +IMPL (__strlen_default, 1) +#else +# define WCSLEN __wcslen_default +# include "wcsmbs/wcslen.c" +IMPL (__wcslen_default, 1) #endif -IMPL (STRLEN, 1) - static void do_one_test (impl_t *impl, const CHAR *s, size_t exp_len)