From patchwork Mon Sep 27 20:38:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 1533540 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=gl34QMNN; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HJDy00ZwLz9t54 for ; Tue, 28 Sep 2021 06:39:03 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 328EC3858432 for ; Mon, 27 Sep 2021 20:38:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 328EC3858432 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1632775135; bh=B08Pt0mFi6boWEUzkCop10L9Mm3mcOtlj9q66sU+8t4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=gl34QMNNB4w9iL4cGIKx+CliTRcfkemVapnFjhITvLtsN0dZPRAf09v35mMFXoQ9M JMxcwvIwllfG/7QZndR9BcC15kUu2ptfN1OQDxnMXUED8sUlqB8amgs51W4uEmiX+q OsMpPwXR1uwzVBn7bxW2NzsXy4GV69xTCwhSEnNc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) by sourceware.org (Postfix) with ESMTPS id 88B123858C2C for ; Mon, 27 Sep 2021 20:38:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 88B123858C2C Received: by mail-io1-xd2a.google.com with SMTP id s20so24489745ioa.4 for ; Mon, 27 Sep 2021 13:38:38 -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:mime-version :content-transfer-encoding; bh=B08Pt0mFi6boWEUzkCop10L9Mm3mcOtlj9q66sU+8t4=; b=cUfZayNkxklhvtR9HbtE3afvhY63rdN3iKo1lsxN2xDXBr350xyWGL5ps9wbUFRgX2 1EebLsZ0CahSFdmQuSkCcK7WjjxHlcfrlHCa0MDu7ktRyFimPMrnnjUbfL0Et0cqc9d/ WnVwiXgr88RtScJudB1IKMAoBKcoz5BPOGTUIyeNu76ON2K9vwjT3JAgk8Ld50/UyI5e qxAnTVNoZdrpcUp+Y29S8FixQAZlYYbGu3wa6VC1IcN7XU5PPWaN2MNQhk7WKi8Gt3WZ 53uahl7Ma6bFNsq6ljeGbk+sjT3egLiUjV1sPh4/ASk/pYELfuXAaqarmxAU/mIX1gqJ aZ2g== X-Gm-Message-State: AOAM53025whcKBlGZJ1mw99ZtYTNLEDuqAINmspgSsvbAidCOG8cLCtu zX5uBgUR6wwC6EY9ShnNbMqOpi/sUCE= X-Google-Smtp-Source: ABdhPJzukqcUgec8VO/OdSE5VFrmhfgzkW6eAq3eJefLpQdzlJjnK1qKaGX0vKVqTSuRxTK+KXNW/w== X-Received: by 2002:a6b:e511:: with SMTP id y17mr1213058ioc.30.1632775117259; Mon, 27 Sep 2021 13:38:37 -0700 (PDT) Received: from localhost.localdomain (node-17-161.flex.volo.net. [76.191.17.161]) by smtp.googlemail.com with ESMTPSA id i132sm9009026ioa.14.2021.09.27.13.38.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Sep 2021 13:38:36 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v1] String: Add support for __memcmpeq() ABI on all targets Date: Mon, 27 Sep 2021 15:38:28 -0500 Message-Id: <20210927203827.2852935-1-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" 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. All tests in string/tester.c passed. As well build succeeds on x86_64-linux-gnu target. --- Note: I did not test with build-many-glibcs.py. So far I have not been able to get it working. The only ABI I tested was x86_64-linux-gnu. Essentially what I did was go through all reference to bcmp() and add the corresponding logic for __memcmpeq(). If bcmp() was missing for any arch then this patch will have missed an alias. There are two places I did not mirror the existing logic for bcmp() I didn't include anything in 'conform/data/strings.h-data'. I also defined __memcmpeq() in 'string/string.h' as opposed to 'string/strings.h'. One thing I am concerned about is some arch having an optimized version of memcmp() but no alias for __memcmpeq(). If this happens replacing the optimized memcmp() will the fallback __memcmpeq() will likely be an anti-optimization. This is a list of all memcmp implementations: '$' means it contains an alias to __memcmpeq() '*' means it includes a file with an alias '^' means its just making declarations '%' means its an implementation without an alias $ sysdeps/sparc/sparc64/memcmp.S $ sysdeps/sparc/sparc32/sparcv9/memcmp.S $ sysdeps/s390/memcmp-z900.S $ sysdeps/s390/memcmp.c $ sysdeps/powerpc/powerpc32/405/memcmp.S $ sysdeps/powerpc/powerpc32/power4/memcmp.S * sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-power7.S * sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S ^ sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c * sysdeps/powerpc/powerpc32/power4/multiarch/rtld-memcmp.S $ sysdeps/powerpc/powerpc32/power7/memcmp.S $ sysdeps/powerpc/powerpc64/power8/memcmp.S $ sysdeps/powerpc/powerpc64/power4/memcmp.S * sysdeps/powerpc/powerpc64/multiarch/memcmp-power7.S * sysdeps/powerpc/powerpc64/multiarch/memcmp-power8.S * sysdeps/powerpc/powerpc64/multiarch/memcmp-power4.S * sysdeps/powerpc/powerpc64/multiarch/memcmp-power10.S ^ sysdeps/powerpc/powerpc64/multiarch/memcmp.c ^ sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c $ sysdeps/powerpc/powerpc64/le/power10/memcmp.S $ sysdeps/powerpc/powerpc64/power7/memcmp.S $ sysdeps/aarch64/memcmp.S $ sysdeps/ia64/memcmp.S $ sysdeps/i386/i686/memcmp.S % sysdeps/i386/i686/multiarch/memcmp-sse4.S % sysdeps/i386/i686/multiarch/memcmp-ssse3.S % sysdeps/i386/i686/multiarch/memcmp-ia32.S $ sysdeps/i386/i686/multiarch/memcmp.c $ sysdeps/i386/memcmp.S $ sysdeps/x86_64/memcmp.S % sysdeps/x86_64/multiarch/memcmp-sse4.S % sysdeps/x86_64/multiarch/memcmp-ssse3.S % sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S % sysdeps/x86_64/multiarch/memcmp-sse2.S % sysdeps/x86_64/multiarch/memcmp-avx2-movbe-rtm.S % sysdeps/x86_64/multiarch/memcmp-evex-movbe.S $ sysdeps/x86_64/multiarch/memcmp.c $ sysdeps/csky/abiv2/memcmp.S $ string/memcmp.c As far as I can tell everything is covered. I tested on x86_64 that the '%' implements will redirect bcmp() to the correct ifunc selection. string/Versions | 3 +++ string/memcmp.c | 2 ++ string/string.h | 13 +++++++++++++ string/tester.c | 16 ++++++++++++++++ sysdeps/aarch64/memcmp.S | 2 ++ sysdeps/csky/abiv2/memcmp.S | 1 + sysdeps/i386/i686/memcmp.S | 2 ++ sysdeps/i386/i686/multiarch/memcmp.c | 1 + sysdeps/i386/memcmp.S | 2 ++ sysdeps/ia64/memcmp.S | 1 + sysdeps/mach/hurd/i386/libc.abilist | 1 + sysdeps/powerpc/powerpc32/405/memcmp.S | 1 + sysdeps/powerpc/powerpc32/power4/memcmp.S | 1 + sysdeps/powerpc/powerpc32/power7/memcmp.S | 1 + sysdeps/powerpc/powerpc64/le/power10/memcmp.S | 1 + sysdeps/powerpc/powerpc64/power4/memcmp.S | 1 + sysdeps/powerpc/powerpc64/power7/memcmp.S | 1 + sysdeps/powerpc/powerpc64/power8/memcmp.S | 1 + sysdeps/s390/memcmp-z900.S | 1 + sysdeps/s390/memcmp.c | 1 + sysdeps/sparc/sparc64/memcmp.S | 2 ++ sysdeps/unix/sysv/linux/aarch64/libc.abilist | 1 + sysdeps/unix/sysv/linux/alpha/libc.abilist | 1 + sysdeps/unix/sysv/linux/arc/libc.abilist | 1 + sysdeps/unix/sysv/linux/arm/be/libc.abilist | 1 + sysdeps/unix/sysv/linux/arm/le/libc.abilist | 1 + sysdeps/unix/sysv/linux/csky/libc.abilist | 1 + sysdeps/unix/sysv/linux/hppa/libc.abilist | 1 + sysdeps/unix/sysv/linux/i386/libc.abilist | 1 + sysdeps/unix/sysv/linux/ia64/libc.abilist | 1 + .../unix/sysv/linux/m68k/coldfire/libc.abilist | 1 + sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist | 1 + .../unix/sysv/linux/microblaze/be/libc.abilist | 1 + .../unix/sysv/linux/microblaze/le/libc.abilist | 1 + .../unix/sysv/linux/mips/mips32/fpu/libc.abilist | 1 + .../sysv/linux/mips/mips32/nofpu/libc.abilist | 1 + .../unix/sysv/linux/mips/mips64/n32/libc.abilist | 1 + .../unix/sysv/linux/mips/mips64/n64/libc.abilist | 1 + sysdeps/unix/sysv/linux/nios2/libc.abilist | 1 + .../linux/powerpc/powerpc32/fpu/libc.abilist | 1 + .../linux/powerpc/powerpc32/nofpu/libc.abilist | 1 + .../sysv/linux/powerpc/powerpc64/be/libc.abilist | 1 + .../sysv/linux/powerpc/powerpc64/le/libc.abilist | 1 + sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist | 1 + sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist | 1 + .../unix/sysv/linux/s390/s390-32/libc.abilist | 1 + .../unix/sysv/linux/s390/s390-64/libc.abilist | 1 + sysdeps/unix/sysv/linux/sh/be/libc.abilist | 1 + sysdeps/unix/sysv/linux/sh/le/libc.abilist | 1 + .../unix/sysv/linux/sparc/sparc32/libc.abilist | 1 + .../unix/sysv/linux/sparc/sparc64/libc.abilist | 1 + sysdeps/unix/sysv/linux/x86_64/64/libc.abilist | 1 + sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist | 1 + sysdeps/x86_64/memcmp.S | 2 ++ sysdeps/x86_64/multiarch/memcmp.c | 2 ++ 55 files changed, 91 insertions(+) diff --git a/string/Versions b/string/Versions index 298ecd401a..864c4cf7a4 100644 --- a/string/Versions +++ b/string/Versions @@ -89,4 +89,7 @@ libc { sigdescr_np; sigabbrev_np; strerrordesc_np; strerrorname_np; } + GLIBC_2.35 { + __memcmpeq; + } } diff --git a/string/memcmp.c b/string/memcmp.c index 9b46d7a905..550b7bb69b 100644 --- a/string/memcmp.c +++ b/string/memcmp.c @@ -358,4 +358,6 @@ libc_hidden_builtin_def(memcmp) #ifdef weak_alias # undef bcmp weak_alias (memcmp, bcmp) +#undef __memcmpeq +weak_alias (memcmp, __memcmpeq) #endif diff --git a/string/string.h b/string/string.h index 04e1b7067d..e953599525 100644 --- a/string/string.h +++ b/string/string.h @@ -64,6 +64,19 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1)); extern int memcmp (const void *__s1, const void *__s2, size_t __n) __THROW __attribute_pure__ __nonnull ((1, 2)); +/* Compare N bytes of S1 and S2. Return zero if S1 and S2 are equals. Return + some non-zero value otherwise. + + Essentially the exact same semantics as memcmp() except the return + value is less constrained. memcmp() is always a correct + implementation of __memcmpeq(). As well !!memcmp(), -memcmp(), or + bcmp() are correct implementations. + + Used by compilers when memcmp() return is only used for its bolean + value. */ +extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n) + __THROW __attribute_pure__ __nonnull ((1, 2)); + /* Search N bytes of S for C. */ #ifdef __CORRECT_ISO_CPP_STRING_H_PROTO extern "C++" diff --git a/string/tester.c b/string/tester.c index 778160ae6e..7d8e1b7c1e 100644 --- a/string/tester.c +++ b/string/tester.c @@ -1449,6 +1449,19 @@ test_bcmp (void) check(bcmp("abc", "def", 0) == 0, 8); /* Zero count. */ } +static void +test_memcmpeq (void) +{ + it = "__memcmpeq"; + check(__memcmpeq("a", "a", 1) == 0, 1); /* Identity. */ + check(__memcmpeq("abc", "abc", 3) == 0, 2); /* Multicharacter. */ + check(__memcmpeq("abcd", "abce", 4) != 0, 3); /* Honestly unequal. */ + check(__memcmpeq("abce", "abcd", 4) != 0, 4); + check(__memcmpeq("alph", "beta", 4) != 0, 5); + check(__memcmpeq("abce", "abcd", 3) == 0, 6); /* Count limited. */ + check(__memcmpeq("abc", "def", 0) == 0, 8); /* Zero count. */ +} + static void test_strerror (void) { @@ -1611,6 +1624,9 @@ main (void) /* bcmp - somewhat like memcmp. */ test_bcmp (); + /* __memcmpeq - somewhat like memcmp. */ + test_memcmpeq (); + /* strndup. */ test_strndup (); diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S index c1937f6f5c..bc932eff2a 100644 --- a/sysdeps/aarch64/memcmp.S +++ b/sysdeps/aarch64/memcmp.S @@ -177,4 +177,6 @@ L(ret_0): END (memcmp) #undef bcmp weak_alias (memcmp, bcmp) +#undef __memcmpeq +weak_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S index 1560387618..d61fca0f29 100644 --- a/sysdeps/csky/abiv2/memcmp.S +++ b/sysdeps/csky/abiv2/memcmp.S @@ -138,5 +138,6 @@ ENTRY (memcmp) br .L_s1_aligned END (memcmp) weak_alias (memcmp, bcmp) +weak_alias (memcmp, __memcmpeq) libc_hidden_def (memcmp) .weak memcmp diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S index b26b124fad..0194f8deab 100644 --- a/sysdeps/i386/i686/memcmp.S +++ b/sysdeps/i386/i686/memcmp.S @@ -405,4 +405,6 @@ L(table_32bytes) : #undef bcmp weak_alias (memcmp, bcmp) +#undef __memcmpeq +weak_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c index 6e058a8857..956fc8e601 100644 --- a/sysdeps/i386/i686/multiarch/memcmp.c +++ b/sysdeps/i386/i686/multiarch/memcmp.c @@ -29,4 +29,5 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ()); weak_alias (memcmp, bcmp) +weak_alias (memcmp, __memcmpeq) #endif diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S index 1f212b0f6d..18e225f963 100644 --- a/sysdeps/i386/memcmp.S +++ b/sysdeps/i386/memcmp.S @@ -70,4 +70,6 @@ END (memcmp) #undef bcmp weak_alias (memcmp, bcmp) +#undef __memcmpeq +weak_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S index 97539c23fd..4488e0eba4 100644 --- a/sysdeps/ia64/memcmp.S +++ b/sysdeps/ia64/memcmp.S @@ -160,4 +160,5 @@ ENTRY(memcmp) END(memcmp) weak_alias (memcmp, bcmp) +weak_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index c5da10a0cd..dcd1fadd88 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -2409,6 +2409,7 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F HURD_CTHREADS_0.3 __cthread_getspecific F HURD_CTHREADS_0.3 __cthread_keycreate F HURD_CTHREADS_0.3 __cthread_setspecific F diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S index 6a6a54d90f..e8b1b6c9bd 100644 --- a/sysdeps/powerpc/powerpc32/405/memcmp.S +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S @@ -126,3 +126,4 @@ L(st2): END (memcmp) libc_hidden_builtin_def (memcmp) weak_alias (memcmp,bcmp) +weak_alias (memcmp, __memcmpeq) diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S index 814d2f211d..e4dde875bb 100644 --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S @@ -1373,3 +1373,4 @@ END (memcmp) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) +weak_alias (memcmp, __memcmpeq) diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S index 8a19953e2d..e60a62fc86 100644 --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S @@ -1373,3 +1373,4 @@ END (memcmp) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) +weak_alias (memcmp, __memcmpeq) diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S index 52f244e7e7..c7fe8047ca 100644 --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S @@ -177,3 +177,4 @@ L(tail8): END (MEMCMP) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) +weak_alias (memcmp, __memcmpeq) diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S index dc1be3a0d8..4ab4a90496 100644 --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S @@ -1374,3 +1374,4 @@ L(duzeroLength): END (MEMCMP) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) +weak_alias (memcmp, __memcmpeq) diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S index bc034a55bc..b541978b5f 100644 --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S @@ -1059,3 +1059,4 @@ L(duzeroLength): END (MEMCMP) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) +weak_alias (memcmp, __memcmpeq) diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S index b676b09a9b..d4f84a5b6f 100644 --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S @@ -1442,3 +1442,4 @@ L(duzeroLength): END (MEMCMP) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) +weak_alias (memcmp, __memcmpeq) diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S index 995d52e47d..0942d32814 100644 --- a/sysdeps/s390/memcmp-z900.S +++ b/sysdeps/s390/memcmp-z900.S @@ -164,6 +164,7 @@ END(MEMCMP_Z196) Otherwise see sysdeps/s390/memcmp.c. */ strong_alias (MEMCMP_DEFAULT, memcmp) weak_alias (memcmp, bcmp) +weak_alias (memcmp, __memcmpeq) #endif #if defined SHARED && IS_IN (libc) diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c index 0b4e9da717..475fc45d3a 100644 --- a/sysdeps/s390/memcmp.c +++ b/sysdeps/s390/memcmp.c @@ -46,4 +46,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp, }) ) weak_alias (memcmp, bcmp); +weak_alias (memcmp, __memcmpeq) #endif diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S index d8d9ff9b24..edcc19915a 100644 --- a/sysdeps/sparc/sparc64/memcmp.S +++ b/sysdeps/sparc/sparc64/memcmp.S @@ -137,4 +137,6 @@ END(memcmp) #undef bcmp weak_alias (memcmp, bcmp) +#undef __memcmpeq +weak_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index 21a2e50a88..8f49b255dd 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -2612,3 +2612,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index a201fd69ba..b655fab937 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -3037,3 +3037,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist index 2611436937..9090fec640 100644 --- a/sysdeps/unix/sysv/linux/arc/libc.abilist +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist @@ -2373,3 +2373,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index a426241965..3e532f3a6e 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -2736,3 +2736,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index 02f80418cc..2376520077 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -2733,3 +2733,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index b7676eb372..70cd0ff05e 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2647,3 +2647,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index f6965c9d95..7056d3e4d6 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2755,3 +2755,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index 2e7603d9ed..8ffd4c2832 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2939,3 +2939,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist index dd3a56d3fe..f8c405a3c1 100644 --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist @@ -2706,3 +2706,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index c1e0ea9c10..c8b7557d26 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -2715,3 +2715,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index 93161048ca..94f983248b 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2882,3 +2882,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index 0aaeec8a27..87f62551fe 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2696,3 +2696,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index bec5f456c9..a30ddf68ef 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2693,3 +2693,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index 97d2127f78..e54c14ccd1 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2843,3 +2843,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index acb0756c11..38aba84dc5 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -2841,3 +2841,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index ebc21dde1e..a3605989e3 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2849,3 +2849,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist index c68f7e3c6c..e6ffe45977 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist @@ -2753,3 +2753,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index e5b6834f14..16776a5d25 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2735,3 +2735,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index 132707c8ad..8dd99682a9 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -3080,3 +3080,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index 0af2be31a0..306c194aca 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -3125,3 +3125,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist index cf864632d0..a8e24f6aae 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist @@ -2836,3 +2836,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist index d566d675d0..f47d906947 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -2808,3 +2808,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist index c9a7eacb32..87b8554999 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist @@ -2375,3 +2375,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist index 8299131cb2..65147c4596 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist @@ -2575,3 +2575,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index c3fe78f77f..d71ddcb6a5 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -3092,3 +3092,4 @@ GLIBC_2.9 pututline F GLIBC_2.9 pututxline F GLIBC_2.9 updwtmp F GLIBC_2.9 updwtmpx F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index 83e542aa8c..88ae19acae 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -2871,3 +2871,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index dc502f6833..5609329d85 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2762,3 +2762,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index cba1abb556..f3ce30fcc5 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2759,3 +2759,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index d4a516fb47..8d67b75244 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -3097,3 +3097,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist index 6268875ba3..999e7c1f05 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist @@ -2729,3 +2729,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index 095e914b73..c5be6ef43e 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -2680,3 +2680,4 @@ GLIBC_2.9 ns_name_skip F GLIBC_2.9 ns_name_uncompress F GLIBC_2.9 ns_name_unpack F GLIBC_2.9 pipe2 F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index dd910f7fe9..cc16ae6335 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -2627,3 +2627,4 @@ GLIBC_2.34 tss_create F GLIBC_2.34 tss_delete F GLIBC_2.34 tss_get F GLIBC_2.34 tss_set F +GLIBC_3.5 __memcmpeq F \ No newline at end of file diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S index 870e15c5a0..f41ae48006 100644 --- a/sysdeps/x86_64/memcmp.S +++ b/sysdeps/x86_64/memcmp.S @@ -358,4 +358,6 @@ END(memcmp) #undef bcmp weak_alias (memcmp, bcmp) +#undef __memcmpeq +weak_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c index fe725f3563..9cc4750bbc 100644 --- a/sysdeps/x86_64/multiarch/memcmp.c +++ b/sysdeps/x86_64/multiarch/memcmp.c @@ -29,6 +29,8 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ()); # undef bcmp weak_alias (memcmp, bcmp) +#undef __memcmpeq +weak_alias (memcmp, __memcmpeq) # ifdef SHARED __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp) From patchwork Fri Oct 22 05:49:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 1544778 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=hHXhtPOs; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HbD571nX7z9sSf for ; Fri, 22 Oct 2021 16:52:11 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F1CCC3857813 for ; Fri, 22 Oct 2021 05:52:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F1CCC3857813 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1634881929; bh=oHGcK8cYIGwTm1uGbgXiXZSb6OMdiqLB95Akf6+m9cw=; 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=hHXhtPOsFTYoveBojzf19FwrDSHfXzc4TfW+lUpj0hHjzZKbmwb+DHVb1OvQeOS3L sLsypnpTzCXJ7R5b9X4MnDY+VvyCnqUSXbgxNczLqH38H1hFXk8MOTS/A6V6MymhjP yE2ni8ZuNechl2dhjyxeLnOcJK1wsQwoARiiGrTA= 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 2D9E03857C52 for ; Fri, 22 Oct 2021 05:51:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2D9E03857C52 Received: by mail-il1-x12c.google.com with SMTP id 3so600232ilq.7 for ; Thu, 21 Oct 2021 22:51:06 -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=oHGcK8cYIGwTm1uGbgXiXZSb6OMdiqLB95Akf6+m9cw=; b=Zb2Nhazrx2m3yJo4mbqYS9FaHPuqfWImDreYKmEeoPk23AykU+BiL5ShKWYMYi7Apl eEkTDYsVLTWxXLWkQLKgTgGUQpXMYcjPJoUbIcF6NYwjswdStmvMj8dg5m9xlrxGFiFw 3WusSZYZnC6VkWQGP9KB2B4olq1YRU5Yed2kGlRoxkoTAkhWmrC/ENnIIafUbE8zZX93 O991oGPSPBg6W1wrNiooJN1SA9URU0cWAqk5lxO1KavRfpuukH9o/CrRFyvdnNB2GBDI 7VU50BZoJeuTPeqkWAEkmeGqoZ+dlcuRGnfHnvuyltNLYsV82M9kF23uyqJLeAbw7ZeH DDYw== X-Gm-Message-State: AOAM5305FYOaUqdUMFIQSTY4CyDTS1pKEE+FJzE7s2eBKL8C8c+VRgc1 mv3Rhsx6tnvzbJJuwKHwb9/7EqYr/XQ= X-Google-Smtp-Source: ABdhPJwPaHusGqWd0vm5tMft/UjUNzrFh3tXF0AQuxmzFGDUb6FwYl4+zTRg93IylGY67ZgCH5F8wg== X-Received: by 2002:a05:6e02:1023:: with SMTP id o3mr6603421ilj.27.1634881865363; Thu, 21 Oct 2021 22:51:05 -0700 (PDT) Received: from localhost.localdomain (node-17-161.flex.volo.net. [76.191.17.161]) by smtp.googlemail.com with ESMTPSA id m188sm3532574ioa.27.2021.10.21.22.51.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 22:51:05 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v9 2/3] String: Add hidden defs for __memcmpeq() to enable internal usage Date: Fri, 22 Oct 2021 00:49:49 -0500 Message-Id: <20211022054949.895120-2-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210927203827.2852935-1-goldstein.w.n@gmail.com> References: <20210927203827.2852935-1-goldstein.w.n@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" No bug. This commit adds hidden defs for all declarations of __memcmpeq. This enables usage of __memcmpeq without the PLT for usage internal to GLIBC. Reviewed-by: H.J. Lu --- include/string.h | 1 + string/memcmp.c | 1 + sysdeps/aarch64/memcmp.S | 1 + sysdeps/csky/abiv2/memcmp.S | 1 + sysdeps/i386/i686/memcmp.S | 1 + sysdeps/i386/i686/multiarch/memcmp.c | 1 + sysdeps/i386/memcmp.S | 1 + sysdeps/ia64/memcmp.S | 1 + sysdeps/powerpc/powerpc32/405/memcmp.S | 1 + sysdeps/powerpc/powerpc32/power4/memcmp.S | 1 + sysdeps/powerpc/powerpc32/power7/memcmp.S | 1 + sysdeps/powerpc/powerpc64/le/power10/memcmp.S | 1 + sysdeps/powerpc/powerpc64/power4/memcmp.S | 1 + sysdeps/powerpc/powerpc64/power7/memcmp.S | 1 + sysdeps/powerpc/powerpc64/power8/memcmp.S | 1 + sysdeps/s390/memcmp-z900.S | 1 + sysdeps/s390/memcmp.c | 1 + sysdeps/sparc/sparc64/memcmp.S | 1 + sysdeps/x86_64/memcmp.S | 1 + sysdeps/x86_64/multiarch/memcmp.c | 1 + 20 files changed, 20 insertions(+) diff --git a/include/string.h b/include/string.h index 81dab39891..21f641a413 100644 --- a/include/string.h +++ b/include/string.h @@ -112,6 +112,7 @@ extern char *__strsep_g (char **__stringp, const char *__delim); libc_hidden_proto (__strsep_g) libc_hidden_proto (strnlen) libc_hidden_proto (__strnlen) +libc_hidden_proto (__memcmpeq) libc_hidden_proto (memmem) extern __typeof (memmem) __memmem; libc_hidden_proto (__memmem) diff --git a/string/memcmp.c b/string/memcmp.c index 6e93a3128f..dc1a94e6ea 100644 --- a/string/memcmp.c +++ b/string/memcmp.c @@ -360,4 +360,5 @@ libc_hidden_builtin_def(memcmp) weak_alias (memcmp, bcmp) # undef __memcmpeq strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) #endif diff --git a/sysdeps/aarch64/memcmp.S b/sysdeps/aarch64/memcmp.S index 37f37b9191..5dc4ee5f0b 100644 --- a/sysdeps/aarch64/memcmp.S +++ b/sysdeps/aarch64/memcmp.S @@ -180,3 +180,4 @@ weak_alias (memcmp, bcmp) #undef __memcmpeq strong_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/csky/abiv2/memcmp.S b/sysdeps/csky/abiv2/memcmp.S index 2a4ae577b0..9aacfd4cab 100644 --- a/sysdeps/csky/abiv2/memcmp.S +++ b/sysdeps/csky/abiv2/memcmp.S @@ -140,4 +140,5 @@ END (memcmp) weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) libc_hidden_def (memcmp) +libc_hidden_def (__memcmpeq) .weak memcmp diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S index 90266d904b..cc3329bef4 100644 --- a/sysdeps/i386/i686/memcmp.S +++ b/sysdeps/i386/i686/memcmp.S @@ -408,3 +408,4 @@ weak_alias (memcmp, bcmp) #undef __memcmpeq strong_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/i386/i686/multiarch/memcmp.c b/sysdeps/i386/i686/multiarch/memcmp.c index 3b2815edbc..eb7cb9f2e2 100644 --- a/sysdeps/i386/i686/multiarch/memcmp.c +++ b/sysdeps/i386/i686/multiarch/memcmp.c @@ -30,4 +30,5 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ()); weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) #endif diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S index 02473c2c0c..f224db4681 100644 --- a/sysdeps/i386/memcmp.S +++ b/sysdeps/i386/memcmp.S @@ -73,3 +73,4 @@ weak_alias (memcmp, bcmp) #undef __memcmpeq strong_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/ia64/memcmp.S b/sysdeps/ia64/memcmp.S index 7722908751..3ab04d4f8a 100644 --- a/sysdeps/ia64/memcmp.S +++ b/sysdeps/ia64/memcmp.S @@ -162,3 +162,4 @@ END(memcmp) weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/powerpc/powerpc32/405/memcmp.S b/sysdeps/powerpc/powerpc32/405/memcmp.S index c2836040a7..339091be0d 100644 --- a/sysdeps/powerpc/powerpc32/405/memcmp.S +++ b/sysdeps/powerpc/powerpc32/405/memcmp.S @@ -127,3 +127,4 @@ END (memcmp) libc_hidden_builtin_def (memcmp) weak_alias (memcmp,bcmp) strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/powerpc/powerpc32/power4/memcmp.S b/sysdeps/powerpc/powerpc32/power4/memcmp.S index f58e34aba5..0df97dbf49 100644 --- a/sysdeps/powerpc/powerpc32/power4/memcmp.S +++ b/sysdeps/powerpc/powerpc32/power4/memcmp.S @@ -1374,3 +1374,4 @@ END (memcmp) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/powerpc/powerpc32/power7/memcmp.S b/sysdeps/powerpc/powerpc32/power7/memcmp.S index f8deb4e32c..25be9a7f51 100644 --- a/sysdeps/powerpc/powerpc32/power7/memcmp.S +++ b/sysdeps/powerpc/powerpc32/power7/memcmp.S @@ -1374,3 +1374,4 @@ END (memcmp) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S index f81c73a29c..b0cd3ddde7 100644 --- a/sysdeps/powerpc/powerpc64/le/power10/memcmp.S +++ b/sysdeps/powerpc/powerpc64/le/power10/memcmp.S @@ -178,3 +178,4 @@ END (MEMCMP) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S index cc82be115f..3731bb0a73 100644 --- a/sysdeps/powerpc/powerpc64/power4/memcmp.S +++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S @@ -1375,3 +1375,4 @@ END (MEMCMP) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/powerpc/powerpc64/power7/memcmp.S b/sysdeps/powerpc/powerpc64/power7/memcmp.S index 3044f7ede9..29ae19d843 100644 --- a/sysdeps/powerpc/powerpc64/power7/memcmp.S +++ b/sysdeps/powerpc/powerpc64/power7/memcmp.S @@ -1060,3 +1060,4 @@ END (MEMCMP) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/powerpc/powerpc64/power8/memcmp.S b/sysdeps/powerpc/powerpc64/power8/memcmp.S index 0c6a154502..897a5713ce 100644 --- a/sysdeps/powerpc/powerpc64/power8/memcmp.S +++ b/sysdeps/powerpc/powerpc64/power8/memcmp.S @@ -1443,3 +1443,4 @@ END (MEMCMP) libc_hidden_builtin_def (memcmp) weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/s390/memcmp-z900.S b/sysdeps/s390/memcmp-z900.S index d625bf90dd..5808f9365d 100644 --- a/sysdeps/s390/memcmp-z900.S +++ b/sysdeps/s390/memcmp-z900.S @@ -165,6 +165,7 @@ END(MEMCMP_Z196) strong_alias (MEMCMP_DEFAULT, memcmp) weak_alias (memcmp, bcmp) strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) #endif #if defined SHARED && IS_IN (libc) diff --git a/sysdeps/s390/memcmp.c b/sysdeps/s390/memcmp.c index 52c20af772..cc58279389 100644 --- a/sysdeps/s390/memcmp.c +++ b/sysdeps/s390/memcmp.c @@ -47,4 +47,5 @@ s390_libc_ifunc_expr (__redirect_memcmp, memcmp, ) weak_alias (memcmp, bcmp); strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) #endif diff --git a/sysdeps/sparc/sparc64/memcmp.S b/sysdeps/sparc/sparc64/memcmp.S index fefeee5f5d..d237945554 100644 --- a/sysdeps/sparc/sparc64/memcmp.S +++ b/sysdeps/sparc/sparc64/memcmp.S @@ -140,3 +140,4 @@ weak_alias (memcmp, bcmp) #undef __memcmpeq strong_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) +libc_hidden_def (__memcmpeq) diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S index f60ddb2ed1..7b7a9dc8e7 100644 --- a/sysdeps/x86_64/memcmp.S +++ b/sysdeps/x86_64/memcmp.S @@ -362,3 +362,4 @@ weak_alias (memcmp, bcmp) definition coming from IFUNC in multiarch/memcmp.c. */ weak_alias (memcmp, __memcmpeq) libc_hidden_builtin_def (memcmp) +libc_hidden_builtin_def (__memcmpeq) diff --git a/sysdeps/x86_64/multiarch/memcmp.c b/sysdeps/x86_64/multiarch/memcmp.c index 4a3aad2c9c..7b3409b1dd 100644 --- a/sysdeps/x86_64/multiarch/memcmp.c +++ b/sysdeps/x86_64/multiarch/memcmp.c @@ -31,6 +31,7 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ()); weak_alias (memcmp, bcmp) # undef __memcmpeq strong_alias (memcmp, __memcmpeq) +libc_hidden_def (__memcmpeq) # ifdef SHARED __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp) From patchwork Fri Oct 22 05:49:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 1544779 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=X530FPyL; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HbD5x056Pz9sSf for ; Fri, 22 Oct 2021 16:52:53 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D06C73857802 for ; Fri, 22 Oct 2021 05:52:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D06C73857802 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1634881970; bh=3cCb8Vs63u+sIbpkktzFujjNi3hf5X21l6AgVIwrwOc=; 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=X530FPyLdnmAp4raC5bnjsuyphPHBxgR/5Pkx4nWhwPPeqI6Cn80iufaDvvId8m7B dwBwpSyw5bv0NIk8QqMGyKChJtO4Mq6wl00yI4sxKtG+kl9866CsHyhcRa/GNWyRTg ZkdYgexQPc5TEyw6wbalz0x4FX4U6BjkEp5AjLg8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by sourceware.org (Postfix) with ESMTPS id 40CAF3857813 for ; Fri, 22 Oct 2021 05:51:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 40CAF3857813 Received: by mail-io1-xd33.google.com with SMTP id y67so3879507iof.10 for ; Thu, 21 Oct 2021 22:51:08 -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=3cCb8Vs63u+sIbpkktzFujjNi3hf5X21l6AgVIwrwOc=; b=CVT1NmNk60oJY5b0R5R+6Q62jh21MkvyplLm6083PpOacaKH6K++l4uv7p2Weo7Jbc tAsvHHzoQWW3S+55F3Fs2TqoN99UOgnGzuSHUO1/FiNMvnEDzZMTs73th/2f97E9LiEA QHcwC5ilu8sv4OZbz6u5jUaz06oSTo5NMdFpBodYIWwtDlHTm4Zl4wBeDiamMvXq1OdG bhGylK76xJS0q39qOmEa8nGnHSNY40GZ2hWpmXevWHvf/WBOpHzacnWTaDpcyphjOSiv gSe/X/q+DOLL3sxI2nwU6X/d4Ujaq/GQ0v6K0tdOAQyfr2VaTUAksN8GHJxiS1/U1FQO 2pfw== X-Gm-Message-State: AOAM531B3AiXAkYAHSlBz9uQO5SL6VEpvJrbZ4pCqlAoCZOfArD2F4T5 UH5jLhsmc7ZSwYPOZTAIQqSgWVLNMgU= X-Google-Smtp-Source: ABdhPJzH3Iufi/zsWN39W/w79Wx/LQ61YJoP6AlaHi+tlS6Tx5XWe/FASeRMT1bZlZlOEZvtYJ0mVQ== X-Received: by 2002:a05:6602:2b8f:: with SMTP id r15mr7389698iov.93.1634881867513; Thu, 21 Oct 2021 22:51:07 -0700 (PDT) Received: from localhost.localdomain (node-17-161.flex.volo.net. [76.191.17.161]) by smtp.googlemail.com with ESMTPSA id m188sm3532574ioa.27.2021.10.21.22.51.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 22:51:07 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v9 3/3] String: Add tests for __memcmpeq Date: Fri, 22 Oct 2021 00:49:50 -0500 Message-Id: <20211022054949.895120-3-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210927203827.2852935-1-goldstein.w.n@gmail.com> References: <20210927203827.2852935-1-goldstein.w.n@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 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+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" No bug. This commit adds tests for the new function __memcmpeq. The new tests use the existing tests in 'test-memcmp.c' but relax the result requirement to only check for zero or non-zero returns. All string tests include test-memcmpeq are passing. Reviewed-by: H.J. Lu --- string/Makefile | 4 ++-- string/test-memcmp.c | 32 +++++++++++++++++++++----------- string/test-memcmpeq.c | 21 +++++++++++++++++++++ 3 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 string/test-memcmpeq.c diff --git a/string/Makefile b/string/Makefile index f0fce2a0b8..40d6fac133 100644 --- a/string/Makefile +++ b/string/Makefile @@ -48,8 +48,8 @@ routines := strcat strchr strcmp strcoll strcpy strcspn \ sigdescr_np sigabbrev_np strerrorname_np \ strerrordesc_np -strop-tests := memchr memcmp memcpy memmove mempcpy memset memccpy \ - stpcpy stpncpy strcat strchr strcmp strcpy strcspn \ +strop-tests := memchr memcmp memcpy memcmpeq memmove mempcpy memset \ + memccpy stpcpy stpncpy strcat strchr strcmp strcpy strcspn \ strlen strncmp strncpy strpbrk strrchr strspn memmem \ strstr strcasestr strnlen strcasecmp strncasecmp \ strncat rawmemchr strchrnul bcopy bzero memrchr \ diff --git a/string/test-memcmp.c b/string/test-memcmp.c index 6ddbc05d2f..70529137ae 100644 --- a/string/test-memcmp.c +++ b/string/test-memcmp.c @@ -17,11 +17,14 @@ . */ #define TEST_MAIN -#ifdef WIDE +#ifdef TEST_MEMCMPEQ +# define TEST_NAME "__memcmpeq" +#elif defined WIDE # define TEST_NAME "wmemcmp" #else # define TEST_NAME "memcmp" #endif + #include "test-string.h" #ifdef WIDE # include @@ -35,6 +38,7 @@ # define CHARBYTES 4 # define CHAR__MIN WCHAR_MIN # define CHAR__MAX WCHAR_MAX + int simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n) { @@ -48,10 +52,14 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n) } #else # include - -# define MEMCMP memcmp +# ifdef TEST_MEMCMPEQ +# define MEMCMP __memcmpeq +# define SIMPLE_MEMCMP simple_memcmpeq +# else +# define MEMCMP memcmp +# define SIMPLE_MEMCMP simple_memcmp +# endif # define MEMCPY memcpy -# define SIMPLE_MEMCMP simple_memcmp # define CHAR char # define MAX_CHAR 255 # define UCHAR unsigned char @@ -60,7 +68,7 @@ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n) # define CHAR__MAX CHAR_MAX 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; @@ -69,6 +77,12 @@ simple_memcmp (const char *s1, const char *s2, size_t n) } #endif +#ifndef BAD_RESULT +# define BAD_RESULT(result, expec) \ + (((result) == 0 && (expec)) || ((result) < 0 && (expec) >= 0) || \ + ((result) > 0 && (expec) <= 0)) +# endif + typedef int (*proto_t) (const CHAR *, const CHAR *, size_t); IMPL (SIMPLE_MEMCMP, 0) @@ -79,9 +93,7 @@ check_result (impl_t *impl, const CHAR *s1, const CHAR *s2, size_t len, int exp_result) { int result = CALL (impl, s1, s2, len); - if ((exp_result == 0 && result != 0) - || (exp_result < 0 && result >= 0) - || (exp_result > 0 && result <= 0)) + if (BAD_RESULT(result, exp_result)) { error (0, 0, "Wrong result in function %s %d %d", impl->name, result, exp_result); @@ -186,9 +198,7 @@ do_random_tests (void) { r = CALL (impl, (CHAR *) p1 + align1, (const CHAR *) p2 + align2, len); - if ((r == 0 && result) - || (r < 0 && result >= 0) - || (r > 0 && result <= 0)) + if (BAD_RESULT(r, result)) { error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd, %zd) %ld != %d, p1 %p p2 %p", n, impl->name, align1 * CHARBYTES & 63, align2 * CHARBYTES & 63, len, pos, r, result, p1, p2); diff --git a/string/test-memcmpeq.c b/string/test-memcmpeq.c new file mode 100644 index 0000000000..8889117868 --- /dev/null +++ b/string/test-memcmpeq.c @@ -0,0 +1,21 @@ +/* Test and measure __memcmpeq functions. + Copyright (C) 2012-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 BAD_RESULT(result, expec) ((!(result)) != (!(expec))) +#define TEST_MEMCMPEQ 1 +#include "test-memcmp.c" From patchwork Fri Oct 22 18:37: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: 1545035 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=dhVqUMuN; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HbY725wK2z9sXM for ; Sat, 23 Oct 2021 05:39:58 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9F96C385782A for ; Fri, 22 Oct 2021 18:39:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F96C385782A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1634927996; bh=2UG3LQ60iiU7PDjkbPeGlJfrcLxvPq6JTacU6XR8wMo=; 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=dhVqUMuN/pZzPIHI84p8f3ASn9OcMoLMxqzos+9EL8CQ/PJPBgEx2PTzriSDe8ZQr PN7zCkqru7fmFzNTQuGLUJ5Ie+AzQH51up8FsosI2Oqeh9N/xNuppMa0BP1T0g6sn9 9dTxv0+NkKeiYkf+/K0baZBO6rKMOkXYh/W/VPcA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by sourceware.org (Postfix) with ESMTPS id 3B3A43858416 for ; Fri, 22 Oct 2021 18:38:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3B3A43858416 Received: by mail-il1-x12b.google.com with SMTP id i6so5228382ila.12 for ; Fri, 22 Oct 2021 11:38:12 -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=2UG3LQ60iiU7PDjkbPeGlJfrcLxvPq6JTacU6XR8wMo=; b=524sNE4Ln9SJM6OprgoEscw1xLFWEZ9g/jmA+Nug6a9MvBt7yGLKfnDravwgl0nelI J6IPGOgDJoZPPgjxKrZpdp0h0tJvO+nrKJdQjscJNbo600iTbk7p99cVZaM57XcUOyNl kbzJeA2eaqI0vj+8hfgOsI9iNRLpmrHsmptCHf2QP+RJ4WzA2sOu27ZdNef6vgUqSXev lsr30akd7nPuNV1z+rKMHoDqAtnHa6qu5qIZul1ukruPuk23Z0rYA5DWSDwpgVssg1XP L+NOPku1XPI3Rv09vVcKhqlPgtVYHKEPvROZqSnz/LizC+HMELsaqnI+wIj7YTLw0ese W+wg== X-Gm-Message-State: AOAM531QJo5T4DOdFuTwUYxjbqSaC1ekSJJAdhrCZzrKzh2OFN+adcMw H3cAso28/T5cMhLHk1+nFxkRCDaD8DU= X-Google-Smtp-Source: ABdhPJxs5Uz5qGMU5dUrNH3iXK+zHGQf0ZBSYpbhpnJLPO/x6lt1SXQd8ZRDOZcnQqQu7gmgBU/xCw== X-Received: by 2002:a05:6e02:1985:: with SMTP id g5mr1114763ilf.158.1634927891490; Fri, 22 Oct 2021 11:38:11 -0700 (PDT) Received: from localhost.localdomain (node-17-161.flex.volo.net. [76.191.17.161]) by smtp.googlemail.com with ESMTPSA id w11sm4460094ior.40.2021.10.22.11.38.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Oct 2021 11:38:11 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v11 4/4] NEWS: Add item for __memcmpeq Date: Fri, 22 Oct 2021 13:37:19 -0500 Message-Id: <20211022183718.1860579-4-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210927203827.2852935-1-goldstein.w.n@gmail.com> References: <20210927203827.2852935-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, 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+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index b39b1e5e33..82b7016aef 100644 --- a/NEWS +++ b/NEWS @@ -60,6 +60,10 @@ Major new features: DSO sorting algorithms. The default setting of '1' uses the current existing algorithm, while a value of '2' selects the new DFS-based algorithm. +* ABI support for a new function '__memcmpeq'. '__memcmpeq' is meant + to be used by compilers for optimizing usage of 'memcmp' when its + return value is only used for its boolean status. + Deprecated and removed features, and other changes affecting compatibility: * The r_version update in the debugger interface makes the glibc binary