From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 C92353858D1E for ; Mon, 6 Feb 2023 17:36:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C92353858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ot1-x32d.google.com with SMTP id e21-20020a9d5615000000b006884e5dce99so3402137oti.5 for ; Mon, 06 Feb 2023 09:36:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=M5l6v0Yj6lc3OjyEUO1FhowwOs1+6z4K08S9MnWnp5s=; b=vo5uD7eISGHidXHUS7WIlzj46oDsUQTmXUiDQYrcH3lxTG08D2Cbzn3PmbBEQQ1WJa Ov+UubyVTs/YHhjBPexLYh2eweZ4zXFpOUwI24V2BHaD8/rV73/v5n+PR4tQpQeO0cWV kgWkzA5+iqF05wmZtbJPQuBNqFE/LRX0vkbMXhZz75bn/OXIE8J7n6OTx0Xs/Nw4nr0G iaszTUyLr+HnVexGtCAm+ym8GmT11lIjdCo4fxlIpCwbpzNVnNqlyR84MC6G429RSgSL Q0pU6sbT9/BnpgsqzSkS2qYJMMazcrxokKY3HCbCGXuQdjrjI6c6n+aWEYoA2/Hd4H1V KBjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=M5l6v0Yj6lc3OjyEUO1FhowwOs1+6z4K08S9MnWnp5s=; b=zDwvwoMBIhVtimF4GZdYk5gl1A7kBjjGU1BbhLUJTKkjNrFMAnDIlnwL4Kq44Xlwpg cbY+GPZZLlqTuB4QejLZVM9WQe1uVGM9wKF6nm8zaEzvb0D7bPx116GznYb/YYl1s1S4 V7FDFUCwblbokQgDytPh2/4yMooT41LYymBNBa1a9CJIfYLM2+8xBWKVXESTGW/DpzRf igOlx14I8ckm0gKf7ETr6dKY0vaKjLSgNqVnR9nwmrvTV4tkxoz//z4HRbuqF/6FjeDR avKkZMq8d1TF3fKMKSrDayhQvTjQcq/qX3Nx0NlpL1Aj+9OkfZR29FVkD4CvTn0xnTbN eSyA== X-Gm-Message-State: AO0yUKVFw+JCG2JOsE1OoS0hTGN2nSl30I/2DIxhlyeJyru8cyTzFPbK n/2PO7JwmIBoNrEPjGFgQoXDfw== X-Google-Smtp-Source: AK7set80/ghy/LrjmzsiSAIvl5RBo8hs2u61Y21beTP2KqHprbt26c/O0d2YywwNcVN4BsHcL1PyFQ== X-Received: by 2002:a05:6830:237a:b0:66c:4d30:b69f with SMTP id r26-20020a056830237a00b0066c4d30b69fmr165671oth.24.1675704997806; Mon, 06 Feb 2023 09:36:37 -0800 (PST) Received: from ?IPV6:2804:1b3:a7c2:8ced:8a3:838:7129:e0bf? ([2804:1b3:a7c2:8ced:8a3:838:7129:e0bf]) by smtp.gmail.com with ESMTPSA id i11-20020a9d53cb000000b0068d4dda3d61sm5168114oth.39.2023.02.06.09.36.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Feb 2023 09:36:36 -0800 (PST) Message-ID: <9c5b5891-7c5b-c03a-341e-522ff24cc3dd@linaro.org> Date: Mon, 6 Feb 2023 14:36:33 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v12 22/31] string: Hook up the default implementation on test-strlen Content-Language: en-US To: Noah Goldstein Cc: libc-alpha@sourceware.org, Richard Henderson , Jeff Law , Xi Ruoyao References: <20230202181149.2181553-1-adhemerval.zanella@linaro.org> <20230202181149.2181553-23-adhemerval.zanella@linaro.org> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,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 List-Id: On 03/02/23 20:30, Noah Goldstein wrote: > On Thu, Feb 2, 2023 at 12:12 PM Adhemerval Zanella > wrote: >> >> Also remove the simple_STRLEN and builtin_strlen, which are not used >> anywhere. > Think I'm slightly opposed to removing the simple_* test implementations > as they can be useful to hook in when debugging. I think the simple_* test are really easy to come by if you need to debug a string/memory implementation; and they do consume CPU cycles on testing with no apparent gain. >> >> Reviewed-by: Richard Henderson >> --- >> string/test-strlen.c | 31 ++++++++++++++----------------- >> 1 file changed, 14 insertions(+), 17 deletions(-) >> >> 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) >> -- >> 2.34.1 >>