about summary refs log tree commit diff
path: root/sysdeps/x86_64/multiarch/wmemcmp-sse2.S
diff options
context:
space:
mode:
authorNoah Goldstein <goldstein.w.n@gmail.com>2022-04-15 12:27:59 -0500
committerNoah Goldstein <goldstein.w.n@gmail.com>2022-04-15 13:08:35 -0500
commit8804157ad9da39631703b92315460808eac86b0c (patch)
tree5d36f2ab234e5e23941090cf2deffe8fcb20ea73 /sysdeps/x86_64/multiarch/wmemcmp-sse2.S
parentac0d208b54fe78ff378afce8003467c763c6a74a (diff)
downloadglibc-8804157ad9da39631703b92315460808eac86b0c.tar.gz
glibc-8804157ad9da39631703b92315460808eac86b0c.tar.xz
glibc-8804157ad9da39631703b92315460808eac86b0c.zip
x86: Optimize memcmp SSE2 in memcmp.S
New code save size (-303 bytes) and has significantly better
performance.

geometric_mean(N=20) of page cross cases New / Original: 0.634
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
Diffstat (limited to 'sysdeps/x86_64/multiarch/wmemcmp-sse2.S')
-rw-r--r--sysdeps/x86_64/multiarch/wmemcmp-sse2.S25
1 files changed, 25 insertions, 0 deletions
diff --git a/sysdeps/x86_64/multiarch/wmemcmp-sse2.S b/sysdeps/x86_64/multiarch/wmemcmp-sse2.S
new file mode 100644
index 0000000000..57be1c446e
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/wmemcmp-sse2.S
@@ -0,0 +1,25 @@
+/* wmemcmp optimized with SSE2.
+   Copyright (C) 2022 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
+   <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"