mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-03 11:12:27 +00:00
Make more code aarch64 friendly
This commit is contained in:
parent
ca2860947f
commit
2b73e72d59
568 changed files with 2197 additions and 1061 deletions
|
@ -30,6 +30,7 @@ typedef char16_t xmm_t __attribute__((__vector_size__(16), __aligned__(16)));
|
|||
* @asyncsignalsafe
|
||||
*/
|
||||
noasan size_t strlen16(const char16_t *s) {
|
||||
#ifdef __x86_64__
|
||||
size_t n;
|
||||
xmm_t z = {0};
|
||||
unsigned m, k = (uintptr_t)s & 15;
|
||||
|
@ -40,4 +41,9 @@ noasan size_t strlen16(const char16_t *s) {
|
|||
n = (const char16_t *)p + (__builtin_ctzl(m) >> 1) - s;
|
||||
if (IsAsan()) __asan_verify(s, n * 2);
|
||||
return n;
|
||||
#else
|
||||
size_t n = 0;
|
||||
while (*s++) ++n;
|
||||
return n;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue