diff options
author | dengjianbo <dengjianbo@loongson.cn> | 2023-08-28 10:08:38 +0800 |
---|---|---|
committer | caiyinyu <caiyinyu@loongson.cn> | 2023-08-29 10:35:38 +0800 |
commit | 1b1e9b7c10f27947a7cddddf95701ec8030167a6 (patch) | |
tree | be3b9a89503dfcd1579cb1d09b1a292055bfa478 /sysdeps/loongarch/lp64/multiarch/dl-symbol-redir-ifunc.h | |
parent | 55e84dc6edc074f0f87a28bafce3249dfed4b201 (diff) | |
download | glibc-1b1e9b7c10f27947a7cddddf95701ec8030167a6.tar.gz glibc-1b1e9b7c10f27947a7cddddf95701ec8030167a6.tar.xz glibc-1b1e9b7c10f27947a7cddddf95701ec8030167a6.zip |
LoongArch: Add ifunc support for memset{aligned, unaligned, lsx, lasx}
According to glibc memset microbenchmark test results, for LSX and LASX versions, A few cases with length less than 8 experience performace degradation, overall, the LASX version could reduce the runtime about 15% - 75%, LSX version could reduce the runtime about 15%-50%. The unaligned version uses unaligned memmory access to set data which length is less than 64 and make address aligned with 8. For this part, the performace is better than aligned version. Comparing with the generic version, the performance is close when the length is larger than 128. When the length is 8-128, the unaligned version could reduce the runtime about 30%-70%, the aligned version could reduce the runtime about 20%-50%.
Diffstat (limited to 'sysdeps/loongarch/lp64/multiarch/dl-symbol-redir-ifunc.h')
-rw-r--r-- | sysdeps/loongarch/lp64/multiarch/dl-symbol-redir-ifunc.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sysdeps/loongarch/lp64/multiarch/dl-symbol-redir-ifunc.h b/sysdeps/loongarch/lp64/multiarch/dl-symbol-redir-ifunc.h new file mode 100644 index 0000000000..e2723873bc --- /dev/null +++ b/sysdeps/loongarch/lp64/multiarch/dl-symbol-redir-ifunc.h @@ -0,0 +1,24 @@ +/* Symbol rediretion for loader/static initialization code. + Copyright (C) 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/>. */ + +#ifndef _DL_IFUNC_GENERIC_H +#define _DL_IFUNC_GENERIC_H + +asm ("memset = __memset_aligned"); + +#endif |