diff options
author | Amrita H S <amritahs@linux.vnet.ibm.com> | 2023-12-06 11:43:11 -0500 |
---|---|---|
committer | Rajalakshmi Srinivasaraghavan <rajis@linux.ibm.com> | 2023-12-07 11:10:40 -0600 |
commit | 3367d8e180848030d1646f088759f02b8dfe0d6f (patch) | |
tree | 1300c2911e4f08b4861bf144b6bcbc54e193b51b /sysdeps/powerpc/powerpc64/multiarch/strcmp-power10.S | |
parent | 546a1ba664626603660b595662249d524e429013 (diff) | |
download | glibc-3367d8e180848030d1646f088759f02b8dfe0d6f.tar.gz glibc-3367d8e180848030d1646f088759f02b8dfe0d6f.tar.xz glibc-3367d8e180848030d1646f088759f02b8dfe0d6f.zip |
powerpc: Optimized strcmp for power10
This patch is based on __strcmp_power9 and __strlen_power10. Improvements from __strcmp_power9: 1. Uses new POWER10 instructions - This code uses lxvp to decrease contention on load by loading 32 bytes per instruction. 2. Performance implication - This version has around 30% better performance on average. - Performance regression is seen for a specific combination of sizes and alignments. Some of them is observed without changes also, while rest may be induced by the patch. Signed-off-by: Amrita H S <amritahs@linux.vnet.ibm.com> Reviewed-by: Paul E. Murphy <murphyp@linux.ibm.com>
Diffstat (limited to 'sysdeps/powerpc/powerpc64/multiarch/strcmp-power10.S')
-rw-r--r-- | sysdeps/powerpc/powerpc64/multiarch/strcmp-power10.S | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp-power10.S b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power10.S new file mode 100644 index 0000000000..c80067ce33 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp-power10.S @@ -0,0 +1,26 @@ +/* Optimized strcmp implementation for POWER10/PPC64. + Copyright (C) 2021-2023 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 defined __LITTLE_ENDIAN__ && IS_IN (libc) +#define STRCMP __strcmp_power10 + +#undef libc_hidden_builtin_def +#define libc_hidden_builtin_def(name) + +#include <sysdeps/powerpc/powerpc64/le/power10/strcmp.S> +#endif /* __LITTLE_ENDIAN__ && IS_IN (libc) */ |