Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145635321
D54776.id170036.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D54776.id170036.diff
View Options
diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc
--- a/lib/libc/aarch64/string/Makefile.inc
+++ b/lib/libc/aarch64/string/Makefile.inc
@@ -42,7 +42,8 @@
memcpy_resolver.c \
memmove_resolver.c \
memset.S \
- memset_resolver.c
+ memset_resolver.c \
+ memset_zva64.S
#
# Add the above functions. Generate an asm file that includes the needed
@@ -77,3 +78,4 @@
CFLAGS.memchr.S+=-I${SRCTOP}/contrib/arm-optimized-routines/string
CFLAGS.memcpy.S+=-I${SRCTOP}/contrib/arm-optimized-routines/string
CFLAGS.memset.S+=-I${SRCTOP}/contrib/arm-optimized-routines/string
+CFLAGS.memset_zva64.S+=-I${SRCTOP}/contrib/arm-optimized-routines/string
diff --git a/lib/libc/aarch64/string/memset_resolver.c b/lib/libc/aarch64/string/memset_resolver.c
--- a/lib/libc/aarch64/string/memset_resolver.c
+++ b/lib/libc/aarch64/string/memset_resolver.c
@@ -25,18 +25,31 @@
* SUCH DAMAGE.
*/
#include <sys/types.h>
+
+#include <machine/armreg.h>
#include <machine/ifunc.h>
#include <elf.h>
void *__memset_aarch64(void *, int, size_t);
+void *__memset_aarch64_zva64(void *, int, size_t);
void *__memset_aarch64_mops(void *, int, size_t);
DEFINE_UIFUNC(, void *, memset, (void *, int, size_t))
{
+ uint64_t dczid;
+
if (ifunc_arg->_hwcap2 & HWCAP2_MOPS)
return (__memset_aarch64_mops);
+ /*
+ * Check for the DC ZVA instruction, and it will
+ * zero 64 bytes (4 * 4byte words).
+ */
+ dczid = READ_SPECIALREG(dczid_el0);
+ if ((dczid & DCZID_DZP) == 0 && DCZID_BS_SIZE(dczid) == 4)
+ return (__memset_aarch64_zva64);
+
return (__memset_aarch64);
}
diff --git a/lib/libc/aarch64/string/memset_zva64.S b/lib/libc/aarch64/string/memset_zva64.S
new file mode 100644
--- /dev/null
+++ b/lib/libc/aarch64/string/memset_zva64.S
@@ -0,0 +1,4 @@
+/* Used when we know we have a 64-byte dc zva instruction */
+#define __memset_aarch64 __memset_aarch64_zva64
+#define SKIP_ZVA_CHECK
+#include "aarch64/memset.S"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 23, 11:22 AM (8 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28935967
Default Alt Text
D54776.id170036.diff (1 KB)
Attached To
Mode
D54776: libc/aarch64: Add memset for a 64 byte dc zva
Attached
Detach File
Event Timeline
Log In to Comment