diff mbox series

[v2] x86: Fix missing __wmemcmp def for disable-multiarch build

Message ID 20220419235252.765256-1-goldstein.w.n@gmail.com
State New
Headers show
Series [v2] x86: Fix missing __wmemcmp def for disable-multiarch build | expand

Commit Message

Noah Goldstein April 19, 2022, 11:52 p.m. UTC
commit 8804157ad9da39631703b92315460808eac86b0c
Author: Noah Goldstein <goldstein.w.n@gmail.com>
Date:   Fri Apr 15 12:27:59 2022 -0500

    x86: Optimize memcmp SSE2 in memcmp.S

Only defined wmemcmp and missed __wmemcmp. This commit fixes that by
defining __wmemcmp and setting wmemcmp as a weak alias to __wmemcmp.

Both multiarch and disable-multiarch builds succeed and full xchecks
pass.
---
 sysdeps/x86_64/multiarch/wmemcmp-sse2.S | 8 ++------
 sysdeps/x86_64/wmemcmp.S                | 6 ++++--
 2 files changed, 6 insertions(+), 8 deletions(-)

Comments

H.J. Lu April 19, 2022, 11:56 p.m. UTC | #1
On Tue, Apr 19, 2022 at 4:53 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> commit 8804157ad9da39631703b92315460808eac86b0c
> Author: Noah Goldstein <goldstein.w.n@gmail.com>
> Date:   Fri Apr 15 12:27:59 2022 -0500
>
>     x86: Optimize memcmp SSE2 in memcmp.S
>
> Only defined wmemcmp and missed __wmemcmp. This commit fixes that by
> defining __wmemcmp and setting wmemcmp as a weak alias to __wmemcmp.
>
> Both multiarch and disable-multiarch builds succeed and full xchecks
> pass.
> ---
>  sysdeps/x86_64/multiarch/wmemcmp-sse2.S | 8 ++------
>  sysdeps/x86_64/wmemcmp.S                | 6 ++++--
>  2 files changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/sysdeps/x86_64/multiarch/wmemcmp-sse2.S b/sysdeps/x86_64/multiarch/wmemcmp-sse2.S
> index 57be1c446e..f09192ed77 100644
> --- a/sysdeps/x86_64/multiarch/wmemcmp-sse2.S
> +++ b/sysdeps/x86_64/multiarch/wmemcmp-sse2.S
> @@ -16,10 +16,6 @@
>     License along with the GNU C Library; if not, see
>     <https://www.gnu.org/licenses/>.  */
>
> -#if IS_IN (libc)
> -# define MEMCMP        __wmemcmp_sse2
> -#else
> -# define MEMCMP        wmemcmp
> -#endif
>  #define USE_AS_WMEMCMP 1
> -#include "memcmp-sse2.S"
> +#define MEMCMP __wmemcmp_sse2
> +#include "../memcmp.S"
> diff --git a/sysdeps/x86_64/wmemcmp.S b/sysdeps/x86_64/wmemcmp.S
> index 032f389158..8bd3cf80db 100644
> --- a/sysdeps/x86_64/wmemcmp.S
> +++ b/sysdeps/x86_64/wmemcmp.S
> @@ -16,6 +16,8 @@
>     License along with the GNU C Library; if not, see
>     <https://www.gnu.org/licenses/>.  */
>
> -#define MEMCMP wmemcmp
> +#define MEMCMP __wmemcmp
>  #define USE_AS_WMEMCMP 1
> -#include "multiarch/memcmp-sse2.S"
> +#include "memcmp.S"
> +
> +weak_alias (__wmemcmp, wmemcmp)
> --
> 2.25.1
>

LGTM.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

Thanks.
Noah Goldstein April 20, 2022, 1:19 a.m. UTC | #2
On Tue, Apr 19, 2022 at 6:56 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Tue, Apr 19, 2022 at 4:53 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> >
> > commit 8804157ad9da39631703b92315460808eac86b0c
> > Author: Noah Goldstein <goldstein.w.n@gmail.com>
> > Date:   Fri Apr 15 12:27:59 2022 -0500
> >
> >     x86: Optimize memcmp SSE2 in memcmp.S
> >
> > Only defined wmemcmp and missed __wmemcmp. This commit fixes that by
> > defining __wmemcmp and setting wmemcmp as a weak alias to __wmemcmp.
> >
> > Both multiarch and disable-multiarch builds succeed and full xchecks
> > pass.
> > ---
> >  sysdeps/x86_64/multiarch/wmemcmp-sse2.S | 8 ++------
> >  sysdeps/x86_64/wmemcmp.S                | 6 ++++--
> >  2 files changed, 6 insertions(+), 8 deletions(-)
> >
> > diff --git a/sysdeps/x86_64/multiarch/wmemcmp-sse2.S b/sysdeps/x86_64/multiarch/wmemcmp-sse2.S
> > index 57be1c446e..f09192ed77 100644
> > --- a/sysdeps/x86_64/multiarch/wmemcmp-sse2.S
> > +++ b/sysdeps/x86_64/multiarch/wmemcmp-sse2.S
> > @@ -16,10 +16,6 @@
> >     License along with the GNU C Library; if not, see
> >     <https://www.gnu.org/licenses/>.  */
> >
> > -#if IS_IN (libc)
> > -# define MEMCMP        __wmemcmp_sse2
> > -#else
> > -# define MEMCMP        wmemcmp
> > -#endif
> >  #define USE_AS_WMEMCMP 1
> > -#include "memcmp-sse2.S"
> > +#define MEMCMP __wmemcmp_sse2
> > +#include "../memcmp.S"
> > diff --git a/sysdeps/x86_64/wmemcmp.S b/sysdeps/x86_64/wmemcmp.S
> > index 032f389158..8bd3cf80db 100644
> > --- a/sysdeps/x86_64/wmemcmp.S
> > +++ b/sysdeps/x86_64/wmemcmp.S
> > @@ -16,6 +16,8 @@
> >     License along with the GNU C Library; if not, see
> >     <https://www.gnu.org/licenses/>.  */
> >
> > -#define MEMCMP wmemcmp
> > +#define MEMCMP __wmemcmp
> >  #define USE_AS_WMEMCMP 1
> > -#include "multiarch/memcmp-sse2.S"
> > +#include "memcmp.S"
> > +
> > +weak_alias (__wmemcmp, wmemcmp)
> > --
> > 2.25.1
> >
>
> LGTM.
>
> Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
>
> Thanks.

Thanks pushed.
>
> --
> H.J.
Sunil Pandey May 12, 2022, 8:04 p.m. UTC | #3
On Tue, Apr 19, 2022 at 6:20 PM Noah Goldstein via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> On Tue, Apr 19, 2022 at 6:56 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Tue, Apr 19, 2022 at 4:53 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> > >
> > > commit 8804157ad9da39631703b92315460808eac86b0c
> > > Author: Noah Goldstein <goldstein.w.n@gmail.com>
> > > Date:   Fri Apr 15 12:27:59 2022 -0500
> > >
> > >     x86: Optimize memcmp SSE2 in memcmp.S
> > >
> > > Only defined wmemcmp and missed __wmemcmp. This commit fixes that by
> > > defining __wmemcmp and setting wmemcmp as a weak alias to __wmemcmp.
> > >
> > > Both multiarch and disable-multiarch builds succeed and full xchecks
> > > pass.
> > > ---
> > >  sysdeps/x86_64/multiarch/wmemcmp-sse2.S | 8 ++------
> > >  sysdeps/x86_64/wmemcmp.S                | 6 ++++--
> > >  2 files changed, 6 insertions(+), 8 deletions(-)
> > >
> > > diff --git a/sysdeps/x86_64/multiarch/wmemcmp-sse2.S b/sysdeps/x86_64/multiarch/wmemcmp-sse2.S
> > > index 57be1c446e..f09192ed77 100644
> > > --- a/sysdeps/x86_64/multiarch/wmemcmp-sse2.S
> > > +++ b/sysdeps/x86_64/multiarch/wmemcmp-sse2.S
> > > @@ -16,10 +16,6 @@
> > >     License along with the GNU C Library; if not, see
> > >     <https://www.gnu.org/licenses/>.  */
> > >
> > > -#if IS_IN (libc)
> > > -# define MEMCMP        __wmemcmp_sse2
> > > -#else
> > > -# define MEMCMP        wmemcmp
> > > -#endif
> > >  #define USE_AS_WMEMCMP 1
> > > -#include "memcmp-sse2.S"
> > > +#define MEMCMP __wmemcmp_sse2
> > > +#include "../memcmp.S"
> > > diff --git a/sysdeps/x86_64/wmemcmp.S b/sysdeps/x86_64/wmemcmp.S
> > > index 032f389158..8bd3cf80db 100644
> > > --- a/sysdeps/x86_64/wmemcmp.S
> > > +++ b/sysdeps/x86_64/wmemcmp.S
> > > @@ -16,6 +16,8 @@
> > >     License along with the GNU C Library; if not, see
> > >     <https://www.gnu.org/licenses/>.  */
> > >
> > > -#define MEMCMP wmemcmp
> > > +#define MEMCMP __wmemcmp
> > >  #define USE_AS_WMEMCMP 1
> > > -#include "multiarch/memcmp-sse2.S"
> > > +#include "memcmp.S"
> > > +
> > > +weak_alias (__wmemcmp, wmemcmp)
> > > --
> > > 2.25.1
> > >
> >
> > LGTM.
> >
> > Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
> >
> > Thanks.
>
> Thanks pushed.
> >
> > --
> > H.J.

I would like to backport this patch to release branches.
Any comments or objections?

--Sunil
diff mbox series

Patch

diff --git a/sysdeps/x86_64/multiarch/wmemcmp-sse2.S b/sysdeps/x86_64/multiarch/wmemcmp-sse2.S
index 57be1c446e..f09192ed77 100644
--- a/sysdeps/x86_64/multiarch/wmemcmp-sse2.S
+++ b/sysdeps/x86_64/multiarch/wmemcmp-sse2.S
@@ -16,10 +16,6 @@ 
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#if IS_IN (libc)
-# define MEMCMP	__wmemcmp_sse2
-#else
-# define MEMCMP	wmemcmp
-#endif
 #define USE_AS_WMEMCMP	1
-#include "memcmp-sse2.S"
+#define MEMCMP	__wmemcmp_sse2
+#include "../memcmp.S"
diff --git a/sysdeps/x86_64/wmemcmp.S b/sysdeps/x86_64/wmemcmp.S
index 032f389158..8bd3cf80db 100644
--- a/sysdeps/x86_64/wmemcmp.S
+++ b/sysdeps/x86_64/wmemcmp.S
@@ -16,6 +16,8 @@ 
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#define MEMCMP	wmemcmp
+#define MEMCMP	__wmemcmp
 #define USE_AS_WMEMCMP	1
-#include "multiarch/memcmp-sse2.S"
+#include "memcmp.S"
+    
+weak_alias (__wmemcmp, wmemcmp)