diff options
author | Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com> | 2020-10-01 21:08:33 -0300 |
---|---|---|
committer | Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com> | 2021-02-17 13:38:29 -0300 |
commit | b50bbee77534c25c341c38702866b2cdf35f3494 (patch) | |
tree | ed44033911b1184aca969bf47786952cfe71730f | |
parent | 7b15dabfdd49a2dcb6d25285f3bcdf880c1dbda5 (diff) | |
download | glibc-b50bbee77534c25c341c38702866b2cdf35f3494.zip glibc-b50bbee77534c25c341c38702866b2cdf35f3494.tar.gz glibc-b50bbee77534c25c341c38702866b2cdf35f3494.tar.bz2 |
powerpc64: Restrict memset implementation that require fixed cache line size
-rw-r--r-- | sysdeps/powerpc/powerpc64/multiarch/bzero.c | 21 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc64/multiarch/memset.c | 22 |
2 files changed, 25 insertions, 18 deletions
diff --git a/sysdeps/powerpc/powerpc64/multiarch/bzero.c b/sysdeps/powerpc/powerpc64/multiarch/bzero.c index c3f819f..305b015 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/bzero.c +++ b/sysdeps/powerpc/powerpc64/multiarch/bzero.c @@ -29,15 +29,18 @@ extern __typeof (bzero) __bzero_power7 attribute_hidden; extern __typeof (bzero) __bzero_power8 attribute_hidden; libc_ifunc (__bzero, - (hwcap2 & PPC_FEATURE2_ARCH_2_07) - ? __bzero_power8 : - (hwcap & PPC_FEATURE_HAS_VSX) - ? __bzero_power7 : - (hwcap & PPC_FEATURE_ARCH_2_05) - ? __bzero_power6 : - (hwcap & PPC_FEATURE_POWER4) - ? __bzero_power4 - : __bzero_ppc); + (hwcap2 & PPC_FEATURE2_ARCH_2_07 + && __GLRO(dl_cache_line_size) == 0x80) + ? __bzero_power8 : + (hwcap & PPC_FEATURE_HAS_VSX + && __GLRO(dl_cache_line_size) == 0x80) + ? __bzero_power7 : + (hwcap & PPC_FEATURE_ARCH_2_05 + && __GLRO(dl_cache_line_size) == 0x80) + ? __bzero_power6 : + (hwcap & PPC_FEATURE_POWER4 && __GLRO(dl_cache_line_size) == 0x80) + ? __bzero_power4 + : __bzero_ppc); weak_alias (__bzero, bzero) #endif diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset.c b/sysdeps/powerpc/powerpc64/multiarch/memset.c index d483f66..dbc737b 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/memset.c +++ b/sysdeps/powerpc/powerpc64/multiarch/memset.c @@ -37,15 +37,19 @@ extern __typeof (__redirect_memset) __memset_power8 attribute_hidden; /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle ifunc symbol properly. */ libc_ifunc (__libc_memset, - (hwcap2 & PPC_FEATURE2_ARCH_2_07) - ? __memset_power8 : - (hwcap & PPC_FEATURE_HAS_VSX) - ? __memset_power7 : - (hwcap & PPC_FEATURE_ARCH_2_05) - ? __memset_power6 : - (hwcap & PPC_FEATURE_POWER4) - ? __memset_power4 - : __memset_ppc); + (hwcap2 & PPC_FEATURE2_ARCH_2_07 + && __GLRO(dl_cache_line_size) == 0x80) + ? __memset_power8 : + (hwcap & PPC_FEATURE_HAS_VSX + && __GLRO(dl_cache_line_size) == 0x80) + ? __memset_power7 : + (hwcap & PPC_FEATURE_ARCH_2_05 + && __GLRO(dl_cache_line_size) == 0x80) + ? __memset_power6 : + (hwcap & PPC_FEATURE_POWER4 + && __GLRO(dl_cache_line_size) == 0x80) + ? __memset_power4 + : __memset_ppc); #undef memset strong_alias (__libc_memset, memset); |