diff options
Diffstat (limited to 'sysdeps/aarch64')
-rw-r--r-- | sysdeps/aarch64/Makefile | 2 | ||||
-rw-r--r-- | sysdeps/aarch64/__mtag_tag_zero_region.S (renamed from sysdeps/aarch64/__mtag_memset_tag.S) | 18 | ||||
-rw-r--r-- | sysdeps/aarch64/libc-mtag.h | 4 |
3 files changed, 10 insertions, 14 deletions
diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile index d3ab37a..259070c 100644 --- a/sysdeps/aarch64/Makefile +++ b/sysdeps/aarch64/Makefile @@ -41,7 +41,7 @@ endif ifeq ($(subdir),misc) sysdep_headers += sys/ifunc.h sysdep_routines += __mtag_address_get_tag \ - __mtag_memset_tag \ + __mtag_tag_zero_region \ __mtag_new_tag \ __mtag_tag_region diff --git a/sysdeps/aarch64/__mtag_memset_tag.S b/sysdeps/aarch64/__mtag_tag_zero_region.S index 3c20288..74d398b 100644 --- a/sysdeps/aarch64/__mtag_memset_tag.S +++ b/sysdeps/aarch64/__mtag_tag_zero_region.S @@ -20,9 +20,6 @@ #ifdef USE_MTAG -/* Use the same register names and assignments as memset. */ -#include "memset-reg.h" - .arch armv8.5-a .arch_extension memtag @@ -31,16 +28,15 @@ /* FIXME: This is a minimal implementation. We could do much better than this for large values of COUNT. */ -ENTRY(__libc_mtag_memset_with_tag) +#define dstin x0 +#define count x1 +#define dst x2 - and valw, valw, 255 - orr valw, valw, valw, lsl 8 - orr valw, valw, valw, lsl 16 - orr val, val, val, lsl 32 - mov dst, dstin +ENTRY(__libc_mtag_tag_zero_region) + mov dst, dstin L(loop): - stgp val, val, [dst], #16 + stzg dst, [dst], #16 subs count, count, 16 bne L(loop) #if 0 @@ -49,5 +45,5 @@ L(loop): ldg dstin, [dstin] // Recover the tag created (might be untagged). #endif ret -END (__libc_mtag_memset_with_tag) +END (__libc_mtag_tag_zero_region) #endif /* USE_MTAG */ diff --git a/sysdeps/aarch64/libc-mtag.h b/sysdeps/aarch64/libc-mtag.h index 979cbb7..f58402c 100644 --- a/sysdeps/aarch64/libc-mtag.h +++ b/sysdeps/aarch64/libc-mtag.h @@ -39,8 +39,8 @@ void *__libc_mtag_tag_region (const void *, size_t) */ void *__libc_mtag_tag_region (void *, size_t); -/* Optimized equivalent to __libc_mtag_tag_region followed by memset. */ -void *__libc_mtag_memset_with_tag (void *, int, size_t); +/* Optimized equivalent to __libc_mtag_tag_region followed by memset to 0. */ +void *__libc_mtag_tag_zero_region (void *, size_t); /* Convert address P to a pointer that is tagged correctly for that location. |