about summary refs log tree commit diff
path: root/sysdeps/loongarch/lp64/multiarch/memcpy-lsx.S
diff options
context:
space:
mode:
authordengjianbo <dengjianbo@loongson.cn>2023-08-15 09:11:53 +0800
committercaiyinyu <caiyinyu@loongson.cn>2023-08-17 10:12:18 +0800
commit8944ba483f9215a4606430b7717f056049863032 (patch)
tree9e5653e5b91867324debc700740aa0b1da6c9b3f /sysdeps/loongarch/lp64/multiarch/memcpy-lsx.S
parentba67bc8e0a682d98583975b4d3896c5d5fbd33d2 (diff)
downloadglibc-8944ba483f9215a4606430b7717f056049863032.tar.gz
glibc-8944ba483f9215a4606430b7717f056049863032.tar.xz
glibc-8944ba483f9215a4606430b7717f056049863032.zip
Loongarch: Add ifunc support for memcpy{aligned, unaligned, lsx, lasx} and memmove{aligned, unaligned, lsx, lasx}
These implementations improve the time to copy data in the glibc
microbenchmark as below:
memcpy-lasx       reduces the runtime about 8%-76%
memcpy-lsx        reduces the runtime about 8%-72%
memcpy-unaligned  reduces the runtime of unaligned data copying up to 40%
memcpy-aligned    reduece the runtime of unaligned data copying up to 25%
memmove-lasx      reduces the runtime about 20%-73%
memmove-lsx       reduces the runtime about 50%
memmove-unaligned reduces the runtime of unaligned data moving up to 40%
memmove-aligned   reduces the runtime of unaligned data moving up to 25%
Diffstat (limited to 'sysdeps/loongarch/lp64/multiarch/memcpy-lsx.S')
-rw-r--r--sysdeps/loongarch/lp64/multiarch/memcpy-lsx.S20
1 files changed, 20 insertions, 0 deletions
diff --git a/sysdeps/loongarch/lp64/multiarch/memcpy-lsx.S b/sysdeps/loongarch/lp64/multiarch/memcpy-lsx.S
new file mode 100644
index 0000000000..6ebbe7a2c7
--- /dev/null
+++ b/sysdeps/loongarch/lp64/multiarch/memcpy-lsx.S
@@ -0,0 +1,20 @@
+/* Optimized memcpy implementation using Loongarch LSX instructions.
+   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/>.  */
+
+/* memcpy is part of memmove.S */