From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by sourceware.org (Postfix) with ESMTPS id 82F783858416 for ; Thu, 21 Oct 2021 19:33:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 82F783858416 Received: by mail-qk1-x72e.google.com with SMTP id d15so2416800qkj.10 for ; Thu, 21 Oct 2021 12:33:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=x3klmBcMaLFt0thRPDg/xgRUp9qX2amqvuAfCJpFako=; b=y3ifEuio9isRtGLSM5HQRJABc6/X47yHNOGcUZbKPA2op87+Z/Afx9AtWkel1bMOYF xfnWnm8x0/h+bi5Seh53U+zRfhkfi0xhJn3AfRcCK2P8PGTikdFbC7sU6QLdWgwU9fCv IwKyFunI4+HPF5NZvzisTNNK0dcmZSFdhS3FUINHhXGRHoMfJKkyFgx/gRkRbQ4afRr9 /50ZoieC0fHYkV0yCy/I4Iu5qKKRqaYE9zo9gjIFWRBQ++xX56Y+YQd0AnrfvfAH8SlV eDLZfw0TWlMFXPtUWF/s3u9p6KY0ikdNobHW8ZRzMAISDH/awbkbkFvM1ga4mm6/KwJw DBcQ== X-Gm-Message-State: AOAM531x7isxB5wZvS+t1c7TfH2W4WycA1vK9SGeT0sTOtMgCScv1dZF etl/VyZ6b5uY4R8wYfQAABMPcQ== X-Google-Smtp-Source: ABdhPJwCTgtBpFrTeQLYV3TQ9zCYrC0Raxa0Pd74Hn/EjU4fy0YXJpvx/B4gA28RgRo4PNSjyBZ/ag== X-Received: by 2002:a37:a191:: with SMTP id k139mr6001380qke.349.1634844804123; Thu, 21 Oct 2021 12:33:24 -0700 (PDT) Received: from ?IPV6:2804:431:c7ca:2654:4963:d466:e6c9:ddbb? ([2804:431:c7ca:2654:4963:d466:e6c9:ddbb]) by smtp.gmail.com with ESMTPSA id c9sm2859009qtp.75.2021.10.21.12.33.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Oct 2021 12:33:23 -0700 (PDT) Message-ID: <8ee11473-cdfd-3dbe-47a1-dffddc996b34@linaro.org> Date: Thu, 21 Oct 2021 16:33:22 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: [PATCH v7] String: Add support for __memcmpeq() ABI on all targets Content-Language: en-US To: Noah Goldstein , libc-alpha@sourceware.org References: <20210927203827.2852935-1-goldstein.w.n@gmail.com> <20210929151743.3351092-1-goldstein.w.n@gmail.com> From: Adhemerval Zanella In-Reply-To: <20210929151743.3351092-1-goldstein.w.n@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, 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-List-Received-Date: Thu, 21 Oct 2021 19:33:25 -0000 On 29/09/2021 12:17, Noah Goldstein via Libc-alpha wrote: > No bug. > > This commit adds support for __memcmpeq() as a new ABI for all > targets. In this commit __memcmpeq() is implemented only as an alias > to the corresponding targets memcmp() implementation. __memcmpeq() is > added as a new symbol starting with GLIBC_2.35 and defined in string.h > with comments explaining its behavior. Basic tests that it is callable > and works where added in string/tester.c > > As discussed in the proposal "Add new ABI '__memcmpeq()' to libc" > __memcmpeq() is essentially a reserved namespace for bcmp(). The means > is shares the same specifications as memcmp() except the return value > for non-equal byte sequences is any non-zero value. This is less > strict than memcmp()'s return value specification and can be better > optimized when a boolean return is all that is needed. > > __memcmpeq() is meant to only be called by compilers if they can prove > that the return value of a memcmp() call is only used for its boolean > value. > Should we export memcmpeq() as a GNU extension as well? > All tests in string/tester.c passed. As well build succeeds on > x86_64-linux-gnu target. This patch requires a NEWS entry for the new symbol and most likely a manual entry to describe its semantic. I also think we should model a new testing based on test-memcmp.c to check for multiple alignments and random inputs.