diff options
author | Branislav Rankov <branislav.rankov@arm.com> | 2020-04-30 14:47:07 +0100 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2020-04-30 14:50:17 +0100 |
commit | 9ebd961562537fc5743eb3fc497f3ff558892237 (patch) | |
tree | 45653f897e8c647acfe30d317d5813c0cdcd4c64 /string/include | |
parent | 232e3c08c9eb9aba822510bae57f920351b1eb40 (diff) | |
download | arm-optimized-routines-9ebd961562537fc5743eb3fc497f3ff558892237.tar.gz |
string: ARMv8.5 MTE: Add MTE compatible version of strcmp.
Reading outside the range of the string is only allowed within 16 byte
aligned granules when MTE is enabled.
This implementation is based on string/aarch64/strcmp.S
Change the case when strings are are misaligned, align the pointers
down, and ignore bytes before the start of the string. Carry the part
that is not compared to the next comparison.
Testing done:
optimized-routines/string/test/strcmp.c on big and little endian.
Booted nanodroid with MTE enabled.
bionic string tests with MTE enabled.
Benchmarks results:
Run both bionic benchmarks and glibc benchmarks on Pixel4. Cores A76 and A55.
Diffstat (limited to 'string/include')
-rw-r--r-- | string/include/stringlib.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/string/include/stringlib.h b/string/include/stringlib.h index fd2e3fc..dff5114 100644 --- a/string/include/stringlib.h +++ b/string/include/stringlib.h @@ -32,6 +32,7 @@ char *__strchr_aarch64_mte (const char *, int); char * __strchrnul_aarch64_mte (const char *, int ); size_t __strlen_aarch64_mte (const char *); char *__strrchr_aarch64_mte (const char *, int); +int __strcmp_aarch64_mte (const char *, const char *); #if __ARM_NEON void *__memcpy_aarch64_simd (void *__restrict, const void *__restrict, size_t); void *__memmove_aarch64_simd (void *, const void *, size_t); |