id stringlengths 22 129 | text stringlengths 60 19.5k | arch stringclasses 9
values | syntax stringclasses 5
values | kind stringclasses 4
values | repo stringclasses 32
values | path stringlengths 7 108 | license stringclasses 10
values | commit stringlengths 40 40 | source_host stringclasses 1
value | category stringclasses 15
values | source_url stringlengths 85 192 | line_start int64 1 5.48k | line_end int64 4 5.5k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bminor/glibc:sysdeps/aarch64/strcpy.S:5 | ret
L(fp_le8):
rev has_nul1, has_nul1
clz pos, has_nul1
add dst, dstin, pos, lsr #3 /* Bits to bytes. */
subs tmp2, pos, #24 /* Pos in bits. */
b.lt L(fp_lt4)
#ifdef __AARCH64EB__
mov tmp2, #56
sub pos, tmp2, pos
lsr data2, data1, pos
lsr data1, data1, #32
#else
lsr data2, data1, tmp2
#endif
/* 4->7 byt... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strcpy.S | LGPL-2.1 | f7a9f785e547bd599dee496fd906a28bcb4ec7fe | github | libc | https://github.com/bminor/glibc/blob/f7a9f785e547bd599dee496fd906a28bcb4ec7fe/sysdeps/aarch64/strcpy.S | 161 | 220 |
bminor/glibc:sysdeps/aarch64/strcpy.S:6 | /* Aligning here ensures that the entry code and main loop all lies
within one 64-byte cache line. */
L(bulk_entry):
sub to_align, to_align, #16
stp data1, data2, [dstin]
sub src, srcin, to_align
sub dst, dstin, to_align
b L(entry_no_page_cross)
/* The inner loop deals with two Dwords at a time. This has a... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strcpy.S | LGPL-2.1 | f7a9f785e547bd599dee496fd906a28bcb4ec7fe | github | libc | https://github.com/bminor/glibc/blob/f7a9f785e547bd599dee496fd906a28bcb4ec7fe/sysdeps/aarch64/strcpy.S | 201 | 260 |
bminor/glibc:sysdeps/aarch64/strcpy.S:7 | #else
csel has_nul1, has_nul1, has_nul2, ne
#endif
rev has_nul1, has_nul1
clz pos, has_nul1
add tmp1, pos, #72
add pos, pos, #8
csel pos, pos, tmp1, ne
add src, src, pos, lsr #3
add dst, dst, pos, lsr #3
ldp data1, data2, [src, #-32]
stp data1, data2, [dst, #-16]
#ifdef BUILD_STPCPY
sub dstin, dst, #1
#endif... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strcpy.S | LGPL-2.1 | f7a9f785e547bd599dee496fd906a28bcb4ec7fe | github | libc | https://github.com/bminor/glibc/blob/f7a9f785e547bd599dee496fd906a28bcb4ec7fe/sysdeps/aarch64/strcpy.S | 241 | 300 |
bminor/glibc:sysdeps/aarch64/strcpy.S:8 | bic has_nul1, tmp1, tmp2
bics has_nul2, tmp3, tmp4
ccmp has_nul1, #0, #0, eq /* NZCV = 0000 */
b.eq L(page_cross_ok)
/* We now need to make data1 and data2 look like they've been
loaded directly from srcin. Do a rotate on the 128-bit value. */
lsl tmp1, to_align, #3 /* Bytes->bits. */
neg tmp2, to_align, ... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strcpy.S | LGPL-2.1 | f7a9f785e547bd599dee496fd906a28bcb4ec7fe | github | libc | https://github.com/bminor/glibc/blob/f7a9f785e547bd599dee496fd906a28bcb4ec7fe/sysdeps/aarch64/strcpy.S | 281 | 326 |
bminor/glibc:sysdeps/aarch64/strcpy.S:1 | /* strcpy/stpcpy - copy a string returning pointer to start/end.
Copyright (C) 2013-2015 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 publish... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strcpy.S | LGPL-2.1 | 890b7a4b33d482b5c768ab47d70758b80227e9bc | github | libc | https://github.com/bminor/glibc/blob/890b7a4b33d482b5c768ab47d70758b80227e9bc/sysdeps/aarch64/strcpy.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Generic optimized strlen using SIMD.
Copyright (C) 2012-2026 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 ... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:2 | #define vdata v0
#define vhas_nul v1
#define vend v2
#define dend d2
/* Core algorithm:
Process the string in 16-byte aligned chunks. Compute a 64-bit mask with
four bits per byte using the shrn instruction. A count trailing zeros then
identifies the first zero byte. */
ENTRY (STRLEN)
bic src, srcin, 15... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/aarch64/strlen.S | 41 | 100 |
bminor/glibc:sysdeps/aarch64/strlen.S:3 | .p2align 5
L(loop):
ldr data, [src, 32]!
cmeq vhas_nul.16b, vdata.16b, 0
addhn vend.8b, vhas_nul.8h, vhas_nul.8h
fmov synd, dend
cbnz synd, L(loop_end)
ldr data, [src, 16]
cmeq vhas_nul.16b, vdata.16b, 0
addhn vend.8b, vhas_nul.8h, vhas_nul.8h
fmov synd, dend
cbz synd, L(loop)
add src, src, 16
L(loop_end):
... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/aarch64/strlen.S | 81 | 107 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Generic optimized strlen using SIMD.
Copyright (C) 2012-2025 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 ... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | ce2f26a22e6b6f5c108d156afd9b43a452bb024c | github | libc | https://github.com/bminor/glibc/blob/ce2f26a22e6b6f5c108d156afd9b43a452bb024c/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Generic optimized strlen using SIMD.
Copyright (C) 2012-2025 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 ... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 2642002380aafb71a1d3b569b6d7ebeab3284816 | github | libc | https://github.com/bminor/glibc/blob/2642002380aafb71a1d3b569b6d7ebeab3284816/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:2 | #define vdata v0
#define vhas_nul v1
#define vend v2
#define dend d2
/* Core algorithm:
Process the string in 16-byte aligned chunks. Compute a 64-bit mask with
four bits per byte using the shrn instruction. A count trailing zeros then
identifies the first zero byte. */
ENTRY (STRLEN)
PTR_ARG (0)
bic s... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 2642002380aafb71a1d3b569b6d7ebeab3284816 | github | libc | https://github.com/bminor/glibc/blob/2642002380aafb71a1d3b569b6d7ebeab3284816/sysdeps/aarch64/strlen.S | 41 | 100 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Generic optimized strlen using SIMD.
Copyright (C) 2012-2024 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 ... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 3dc426b642dcafdbc11a99f2767e081d086f5fc7 | github | libc | https://github.com/bminor/glibc/blob/3dc426b642dcafdbc11a99f2767e081d086f5fc7/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Copyright (C) 2012-2024 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | dff8da6b3e89b986bb7f6b1ec18cf65d5972e307 | github | libc | https://github.com/bminor/glibc/blob/dff8da6b3e89b986bb7f6b1ec18cf65d5972e307/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:2 | #define vhas_nul v1
#define vend v2
#define dend d2
/* Core algorithm:
Process the string in 16-byte aligned chunks. Compute a 64-bit mask with
four bits per byte using the shrn instruction. A count trailing zeros then
identifies the first zero byte. */
ENTRY (STRLEN)
PTR_ARG (0)
bic src, srcin, 15
ld1... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | dff8da6b3e89b986bb7f6b1ec18cf65d5972e307 | github | libc | https://github.com/bminor/glibc/blob/dff8da6b3e89b986bb7f6b1ec18cf65d5972e307/sysdeps/aarch64/strlen.S | 41 | 93 |
bminor/glibc:sysdeps/aarch64/strlen.S:3 | sub result, src, srcin
fmov synd, dend
#ifndef __AARCH64EB__
rbit synd, synd
#endif
add result, result, 16
clz tmp, synd
add result, result, tmp, lsr 2
ret
END (STRLEN)
weak_alias (STRLEN, strlen)
libc_hidden_builtin_def (strlen) | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | dff8da6b3e89b986bb7f6b1ec18cf65d5972e307 | github | libc | https://github.com/bminor/glibc/blob/dff8da6b3e89b986bb7f6b1ec18cf65d5972e307/sysdeps/aarch64/strlen.S | 81 | 93 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Copyright (C) 2012-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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 03c8ce5000198947a4dd7b2c14e5131738fda62b | github | libc | https://github.com/bminor/glibc/blob/03c8ce5000198947a4dd7b2c14e5131738fda62b/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Copyright (C) 2012-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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 6d7e8eda9b85b08f207a6dc6f187e94e4817270f | github | libc | https://github.com/bminor/glibc/blob/6d7e8eda9b85b08f207a6dc6f187e94e4817270f/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:2 | #define vhas_nul v1
#define vend v2
#define dend d2
/* Core algorithm:
For each 16-byte chunk we calculate a 64-bit nibble mask value with four bits
per byte. We take 4 bits of every comparison byte with shift right and narrow
by 4 instruction. Since the bits in the nibble mask reflect the order in
whic... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 6d7e8eda9b85b08f207a6dc6f187e94e4817270f | github | libc | https://github.com/bminor/glibc/blob/6d7e8eda9b85b08f207a6dc6f187e94e4817270f/sysdeps/aarch64/strlen.S | 41 | 89 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Copyright (C) 2012-2022 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 3c9980698988ef64072f1fac339b180f52792faf | github | libc | https://github.com/bminor/glibc/blob/3c9980698988ef64072f1fac339b180f52792faf/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Copyright (C) 2012-2022 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 581c785bf31bc74430320c7856bbfa3875d025fe | github | libc | https://github.com/bminor/glibc/blob/581c785bf31bc74430320c7856bbfa3875d025fe/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:2 | #define vdata v0
#define vhas_nul v1
#define vrepmask v2
#define vend v3
#define dend d3
/* Core algorithm:
For each 16-byte chunk we calculate a 64-bit syndrome value with four bits
per byte. For even bytes, bits 0-3 are set if the relevant byte matched the
requested character or the byte is NUL. Bits 4-... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 581c785bf31bc74430320c7856bbfa3875d025fe | github | libc | https://github.com/bminor/glibc/blob/581c785bf31bc74430320c7856bbfa3875d025fe/sysdeps/aarch64/strlen.S | 41 | 96 |
bminor/glibc:sysdeps/aarch64/strlen.S:3 | cbz synd, L(loop)
and vhas_nul.16b, vhas_nul.16b, vrepmask.16b
addp vend.16b, vhas_nul.16b, vhas_nul.16b /* 128->64 */
sub result, src, srcin
fmov synd, dend
#ifndef __AARCH64EB__
rbit synd, synd
#endif
clz tmp, synd
add result, result, tmp, lsr 2
ret
END (STRLEN)
weak_alias (STRLEN, strlen)
libc_hidden_buil... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 581c785bf31bc74430320c7856bbfa3875d025fe | github | libc | https://github.com/bminor/glibc/blob/581c785bf31bc74430320c7856bbfa3875d025fe/sysdeps/aarch64/strlen.S | 81 | 96 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Copyright (C) 2012-2021 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Copyright (C) 2012-2020 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 45b1e17e9150dbd9ac2d578579063fbfa8e1b327 | github | libc | https://github.com/bminor/glibc/blob/45b1e17e9150dbd9ac2d578579063fbfa8e1b327/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Copyright (C) 2012-2020 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | a365ac45b7b51dbd9dc65629203cc2a9603420bb | github | libc | https://github.com/bminor/glibc/blob/a365ac45b7b51dbd9dc65629203cc2a9603420bb/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:2 | #define vdata v0
#define vhas_nul v1
#define vrepmask v2
#define vend v3
#define dend d3
/* Core algorithm:
For each 16-byte chunk we calculate a 64-bit syndrome value with four bits
per byte. For even bytes, bits 0-3 are set if the relevant byte matched the
requested character or the byte is NUL. Bits 4-... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | a365ac45b7b51dbd9dc65629203cc2a9603420bb | github | libc | https://github.com/bminor/glibc/blob/a365ac45b7b51dbd9dc65629203cc2a9603420bb/sysdeps/aarch64/strlen.S | 41 | 97 |
bminor/glibc:sysdeps/aarch64/strlen.S:3 | fmov synd, dend
cbz synd, L(loop)
and vhas_nul.16b, vhas_nul.16b, vrepmask.16b
addp vend.16b, vhas_nul.16b, vhas_nul.16b /* 128->64 */
sub result, src, srcin
fmov synd, dend
#ifndef __AARCH64EB__
rbit synd, synd
#endif
clz tmp, synd
add result, result, tmp, lsr 2
ret
END (STRLEN)
weak_alias (STRLEN, strlen)... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | a365ac45b7b51dbd9dc65629203cc2a9603420bb | github | libc | https://github.com/bminor/glibc/blob/a365ac45b7b51dbd9dc65629203cc2a9603420bb/sysdeps/aarch64/strlen.S | 81 | 97 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Copyright (C) 2012-2020 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | d614a7539657941a9201c236b2f15afac18e1213 | github | libc | https://github.com/bminor/glibc/blob/d614a7539657941a9201c236b2f15afac18e1213/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:2 | #define data2 x3
#define has_nul1 x4
#define has_nul2 x5
#define tmp1 x4
#define tmp2 x5
#define tmp3 x6
#define tmp4 x7
#define zeroones x8
/* NUL detection works on the principle that (X - 1) & (~X) & 0x80
(=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and
can be done in parallel across the... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | d614a7539657941a9201c236b2f15afac18e1213 | github | libc | https://github.com/bminor/glibc/blob/d614a7539657941a9201c236b2f15afac18e1213/sysdeps/aarch64/strlen.S | 41 | 100 |
bminor/glibc:sysdeps/aarch64/strlen.S:3 | page in the first 16 bytes are rare (probability of
16/MIN_PAGE_SIZE ~= 0.4%), this case does not need to be optimized.
AArch64 systems have a minimum page size of 4k. We don't bother
checking for larger page sizes - the cost of setting up the correct
page size is just not worth the extra gain from a ... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | d614a7539657941a9201c236b2f15afac18e1213 | github | libc | https://github.com/bminor/glibc/blob/d614a7539657941a9201c236b2f15afac18e1213/sysdeps/aarch64/strlen.S | 81 | 140 |
bminor/glibc:sysdeps/aarch64/strlen.S:4 | csel len, xzr, len, cc
add len, len, tmp1, lsr 3
ret
/* The inner loop processes 32 bytes per iteration and uses the fast
NUL check. If we encounter non-ASCII characters, use a second
loop with the accurate NUL check. */
.p2align 4
L(main_loop_entry):
bic src, srcin, 15
sub src, src, 16
L(main_loop):
... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | d614a7539657941a9201c236b2f15afac18e1213 | github | libc | https://github.com/bminor/glibc/blob/d614a7539657941a9201c236b2f15afac18e1213/sysdeps/aarch64/strlen.S | 121 | 180 |
bminor/glibc:sysdeps/aarch64/strlen.S:5 | easiest way to get the correct byte is to byte-swap the data
and calculate the syndrome a second time. */
csel data1, data1, data2, cc
rev data1, data1
sub tmp1, data1, zeroones
orr tmp2, data1, REP8_7f
bic has_nul1, tmp1, tmp2
#else
csel has_nul1, has_nul1, has_nul2, cc
#endif
sub len, src, srcin
rev has_... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | d614a7539657941a9201c236b2f15afac18e1213 | github | libc | https://github.com/bminor/glibc/blob/d614a7539657941a9201c236b2f15afac18e1213/sysdeps/aarch64/strlen.S | 161 | 220 |
bminor/glibc:sysdeps/aarch64/strlen.S:6 | srcin to 0x7f, so we ignore any NUL bytes before the string.
Then continue in the aligned loop. */
L(page_cross):
bic src, srcin, 15
ldp data1, data2, [src]
lsl tmp1, srcin, 3
mov tmp4, -1
#ifdef __AARCH64EB__
/* Big-endian. Early bytes are at MSB. */
lsr tmp1, tmp4, tmp1 /* Shift (tmp1 & 63). */
#else
/*... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | d614a7539657941a9201c236b2f15afac18e1213 | github | libc | https://github.com/bminor/glibc/blob/d614a7539657941a9201c236b2f15afac18e1213/sysdeps/aarch64/strlen.S | 201 | 224 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Copyright (C) 2012-2019 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 5a82c74822d3272df2f5929133680478c0cfb4bd | github | libc | https://github.com/bminor/glibc/blob/5a82c74822d3272df2f5929133680478c0cfb4bd/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Copyright (C) 2012-2019 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 04277e02d7f54d3582bebcf8386b317018cd5e1d | github | libc | https://github.com/bminor/glibc/blob/04277e02d7f54d3582bebcf8386b317018cd5e1d/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Copyright (C) 2012-2018 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 436e4d5b965abe592d26150cb518accf9ded8fe4 | github | libc | https://github.com/bminor/glibc/blob/436e4d5b965abe592d26150cb518accf9ded8fe4/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Copyright (C) 2012-2018 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | be64b1946b47087fda2e48cfba759cbb4fdfaada | github | libc | https://github.com/bminor/glibc/blob/be64b1946b47087fda2e48cfba759cbb4fdfaada/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:2 | #define tmp2 x5
#define tmp3 x6
#define tmp4 x7
#define zeroones x8
/* NUL detection works on the principle that (X - 1) & (~X) & 0x80
(=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and
can be done in parallel across the entire word. A faster check
(X - 1) & 0x80 is zero for non-NUL ASCII c... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | be64b1946b47087fda2e48cfba759cbb4fdfaada | github | libc | https://github.com/bminor/glibc/blob/be64b1946b47087fda2e48cfba759cbb4fdfaada/sysdeps/aarch64/strlen.S | 41 | 100 |
bminor/glibc:sysdeps/aarch64/strlen.S:3 | checking for larger page sizes - the cost of setting up the correct
page size is just not worth the extra gain from a small reduction in
the cases taking the slow path. Note that we only care about
whether the first fetch, which may be misaligned, crosses a page
boundary. */
ENTRY_ALIGN (__strlen, 6)... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | be64b1946b47087fda2e48cfba759cbb4fdfaada | github | libc | https://github.com/bminor/glibc/blob/be64b1946b47087fda2e48cfba759cbb4fdfaada/sysdeps/aarch64/strlen.S | 81 | 140 |
bminor/glibc:sysdeps/aarch64/strlen.S:4 | /* The inner loop processes 32 bytes per iteration and uses the fast
NUL check. If we encounter non-ASCII characters, use a second
loop with the accurate NUL check. */
.p2align 4
L(main_loop_entry):
bic src, srcin, 15
sub src, src, 16
L(main_loop):
ldp data1, data2, [src, 32]!
L(page_cross_entry):
sub tm... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | be64b1946b47087fda2e48cfba759cbb4fdfaada | github | libc | https://github.com/bminor/glibc/blob/be64b1946b47087fda2e48cfba759cbb4fdfaada/sysdeps/aarch64/strlen.S | 121 | 180 |
bminor/glibc:sysdeps/aarch64/strlen.S:5 | sub tmp1, data1, zeroones
orr tmp2, data1, REP8_7f
bic has_nul1, tmp1, tmp2
#else
csel has_nul1, has_nul1, has_nul2, cc
#endif
sub len, src, srcin
rev has_nul1, has_nul1
add tmp2, len, 8
clz tmp1, has_nul1
csel len, len, tmp2, cc
add len, len, tmp1, lsr 3
ret
L(nonascii_loop):
ldp data1, data2, [src, 16]!
... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | be64b1946b47087fda2e48cfba759cbb4fdfaada | github | libc | https://github.com/bminor/glibc/blob/be64b1946b47087fda2e48cfba759cbb4fdfaada/sysdeps/aarch64/strlen.S | 161 | 220 |
bminor/glibc:sysdeps/aarch64/strlen.S:6 | ldp data1, data2, [src]
lsl tmp1, srcin, 3
mov tmp4, -1
#ifdef __AARCH64EB__
/* Big-endian. Early bytes are at MSB. */
lsr tmp1, tmp4, tmp1 /* Shift (tmp1 & 63). */
#else
/* Little-endian. Early bytes are at LSB. */
lsl tmp1, tmp4, tmp1 /* Shift (tmp1 & 63). */
#endif
orr tmp1, tmp1, REP8_80
orn data1, dat... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | be64b1946b47087fda2e48cfba759cbb4fdfaada | github | libc | https://github.com/bminor/glibc/blob/be64b1946b47087fda2e48cfba759cbb4fdfaada/sysdeps/aarch64/strlen.S | 201 | 220 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Copyright (C) 2012-2018 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 688903eb3ef01301d239ab753d309d45720610a7 | github | libc | https://github.com/bminor/glibc/blob/688903eb3ef01301d239ab753d309d45720610a7/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:2 | #define tmp2 x5
#define tmp3 x6
#define tmp4 x7
#define zeroones x8
/* NUL detection works on the principle that (X - 1) & (~X) & 0x80
(=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and
can be done in parallel across the entire word. A faster check
(X - 1) & 0x80 is zero for non-NUL ASCII c... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 688903eb3ef01301d239ab753d309d45720610a7 | github | libc | https://github.com/bminor/glibc/blob/688903eb3ef01301d239ab753d309d45720610a7/sysdeps/aarch64/strlen.S | 41 | 100 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Copyright (C) 2012-2017 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | bfff8b1becd7d01c074177df7196ab327cd8c844 | github | libc | https://github.com/bminor/glibc/blob/bfff8b1becd7d01c074177df7196ab327cd8c844/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Copyright (C) 2012-2016 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 389d1f1b232b3d6b9d73ee2c50e543ace6675621 | github | libc | https://github.com/bminor/glibc/blob/389d1f1b232b3d6b9d73ee2c50e543ace6675621/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:2 | #define tmp2 x5
#define tmp3 x6
#define tmp4 x7
#define zeroones x8
/* NUL detection works on the principle that (X - 1) & (~X) & 0x80
(=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and
can be done in parallel across the entire word. A faster check
(X - 1) & 0x80 is zero for non-NUL ASCII c... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 58ec4fb881719d0b69989f9a4955290fca531831 | github | libc | https://github.com/bminor/glibc/blob/58ec4fb881719d0b69989f9a4955290fca531831/sysdeps/aarch64/strlen.S | 41 | 100 |
bminor/glibc:sysdeps/aarch64/strlen.S:3 | checking for larger page sizes - the cost of setting up the correct
page size is just not worth the extra gain from a small reduction in
the cases taking the slow path. Note that we only care about
whether the first fetch, which may be misaligned, crosses a page
boundary. */
ENTRY_ALIGN (__strlen, 6)... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 58ec4fb881719d0b69989f9a4955290fca531831 | github | libc | https://github.com/bminor/glibc/blob/58ec4fb881719d0b69989f9a4955290fca531831/sysdeps/aarch64/strlen.S | 81 | 140 |
bminor/glibc:sysdeps/aarch64/strlen.S:4 | loop with the accurate NUL check. */
.p2align 4
L(main_loop_entry):
bic src, srcin, 15
sub src, src, 16
L(main_loop):
ldp data1, data2, [src, 32]!
L(page_cross_entry):
sub tmp1, data1, zeroones
sub tmp3, data2, zeroones
orr tmp2, tmp1, tmp3
tst tmp2, zeroones, lsl 7
bne 1f
ldp data1, data2, [src, 16]
sub tm... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 58ec4fb881719d0b69989f9a4955290fca531831 | github | libc | https://github.com/bminor/glibc/blob/58ec4fb881719d0b69989f9a4955290fca531831/sysdeps/aarch64/strlen.S | 121 | 180 |
bminor/glibc:sysdeps/aarch64/strlen.S:5 | bic has_nul1, tmp1, tmp2
#else
csel has_nul1, has_nul1, has_nul2, cc
#endif
sub len, src, srcin
rev has_nul1, has_nul1
add tmp2, len, 8
clz tmp1, has_nul1
csel len, len, tmp2, cc
add len, len, tmp1, lsr 3
ret
L(nonascii_loop):
ldp data1, data2, [src, 16]!
sub tmp1, data1, zeroones
orr tmp2, data1, REP8_7f
... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 58ec4fb881719d0b69989f9a4955290fca531831 | github | libc | https://github.com/bminor/glibc/blob/58ec4fb881719d0b69989f9a4955290fca531831/sysdeps/aarch64/strlen.S | 161 | 218 |
bminor/glibc:sysdeps/aarch64/strlen.S:6 | mov tmp4, -1
#ifdef __AARCH64EB__
/* Big-endian. Early bytes are at MSB. */
lsr tmp1, tmp4, tmp1 /* Shift (tmp1 & 63). */
#else
/* Little-endian. Early bytes are at LSB. */
lsl tmp1, tmp4, tmp1 /* Shift (tmp1 & 63). */
#endif
orr tmp1, tmp1, REP8_80
orn data1, data1, tmp1
orn tmp2, data2, tmp1
tst srcin, 8... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 58ec4fb881719d0b69989f9a4955290fca531831 | github | libc | https://github.com/bminor/glibc/blob/58ec4fb881719d0b69989f9a4955290fca531831/sysdeps/aarch64/strlen.S | 201 | 218 |
bminor/glibc:sysdeps/aarch64/strlen.S:2 | #define tmp2 x5
#define tmp3 x6
#define tmp4 x7
#define zeroones x8
/* NUL detection works on the principle that (X - 1) & (~X) & 0x80
(=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and
can be done in parallel across the entire word. A faster check
(X - 1) & 0x80 is zero for non-NUL ASCII c... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | f7a9f785e547bd599dee496fd906a28bcb4ec7fe | github | libc | https://github.com/bminor/glibc/blob/f7a9f785e547bd599dee496fd906a28bcb4ec7fe/sysdeps/aarch64/strlen.S | 41 | 100 |
bminor/glibc:sysdeps/aarch64/strlen.S:3 | checking for larger page sizes - the cost of setting up the correct
page size is just not worth the extra gain from a small reduction in
the cases taking the slow path. Note that we only care about
whether the first fetch, which may be misaligned, crosses a page
boundary. */
ENTRY_ALIGN (strlen, 6)
... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | f7a9f785e547bd599dee496fd906a28bcb4ec7fe | github | libc | https://github.com/bminor/glibc/blob/f7a9f785e547bd599dee496fd906a28bcb4ec7fe/sysdeps/aarch64/strlen.S | 81 | 140 |
bminor/glibc:sysdeps/aarch64/strlen.S:5 | bic has_nul1, tmp1, tmp2
#else
csel has_nul1, has_nul1, has_nul2, cc
#endif
sub len, src, srcin
rev has_nul1, has_nul1
add tmp2, len, 8
clz tmp1, has_nul1
csel len, len, tmp2, cc
add len, len, tmp1, lsr 3
ret
L(nonascii_loop):
ldp data1, data2, [src, 16]!
sub tmp1, data1, zeroones
orr tmp2, data1, REP8_7f
... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | f7a9f785e547bd599dee496fd906a28bcb4ec7fe | github | libc | https://github.com/bminor/glibc/blob/f7a9f785e547bd599dee496fd906a28bcb4ec7fe/sysdeps/aarch64/strlen.S | 161 | 217 |
bminor/glibc:sysdeps/aarch64/strlen.S:6 | mov tmp4, -1
#ifdef __AARCH64EB__
/* Big-endian. Early bytes are at MSB. */
lsr tmp1, tmp4, tmp1 /* Shift (tmp1 & 63). */
#else
/* Little-endian. Early bytes are at LSB. */
lsl tmp1, tmp4, tmp1 /* Shift (tmp1 & 63). */
#endif
orr tmp1, tmp1, REP8_80
orn data1, data1, tmp1
orn tmp2, data2, tmp1
tst srcin, 8... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | f7a9f785e547bd599dee496fd906a28bcb4ec7fe | github | libc | https://github.com/bminor/glibc/blob/f7a9f785e547bd599dee496fd906a28bcb4ec7fe/sysdeps/aarch64/strlen.S | 201 | 217 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Copyright (C) 2012-2015 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | c435989f52204703d524f467c830dc363439e532 | github | libc | https://github.com/bminor/glibc/blob/c435989f52204703d524f467c830dc363439e532/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:1 | /* Copyright (C) 2012-2015 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 890b7a4b33d482b5c768ab47d70758b80227e9bc | github | libc | https://github.com/bminor/glibc/blob/890b7a4b33d482b5c768ab47d70758b80227e9bc/sysdeps/aarch64/strlen.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strlen.S:2 | #define zeroones x11
#define pos x12
#define REP8_01 0x0101010101010101
#define REP8_7f 0x7f7f7f7f7f7f7f7f
#define REP8_80 0x8080808080808080
/* Start of critial section -- keep to one 64Byte cache line. */
ENTRY_ALIGN (strlen, 6)
mov zeroones, #REP8_01
bic src, srcin, #15
ands tmp1, srcin, #15
b.ne L(misalign... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 890b7a4b33d482b5c768ab47d70758b80227e9bc | github | libc | https://github.com/bminor/glibc/blob/890b7a4b33d482b5c768ab47d70758b80227e9bc/sysdeps/aarch64/strlen.S | 41 | 100 |
bminor/glibc:sysdeps/aarch64/strlen.S:3 | L(nul_in_data2):
#ifdef __AARCH64EB__
/* For big-endian, carry propagation (if the final byte in the
string is 0x01) means we cannot use has_nul directly. The
easiest way to get the correct byte is to byte-swap the data
and calculate the syndrome a second time. */
rev data2, data2
sub tmp1, data2, zero... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strlen.S | LGPL-2.1 | 890b7a4b33d482b5c768ab47d70758b80227e9bc | github | libc | https://github.com/bminor/glibc/blob/890b7a4b33d482b5c768ab47d70758b80227e9bc/sysdeps/aarch64/strlen.S | 81 | 117 |
bminor/glibc:sysdeps/aarch64/strncmp.S:1 | /* Copyright (C) 2013-2026 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/aarch64/strncmp.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strncmp.S:2 | #define diff x6
#define syndrome x7
#define tmp1 x8
#define tmp2 x9
#define tmp3 x10
#define zeroones x11
#define pos x12
#define mask x13
#define endloop x14
#define count mask
#define offset pos
#define neg_offset x15
/* Define endian dependent shift operations.
On big-endian early bytes are at MSB and o... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/aarch64/strncmp.S | 41 | 100 |
bminor/glibc:sysdeps/aarch64/strncmp.S:3 | /* NUL detection works on the principle that (X - 1) & (~X) & 0x80
(=> (X - 1) & ~(X | 0x7f)) is non-zero iff a byte is zero, and
can be done in parallel across the entire word. */
/* Start of performance-critical section -- one 64B cache line. */
L(loop_aligned):
ldr data1, [src1], #8
ldr data2, [src2], ... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/aarch64/strncmp.S | 81 | 140 |
bminor/glibc:sysdeps/aarch64/strncmp.S:4 | tbz limit, #63, L(not_limit)
add tmp1, limit, 8
cbz limit, L(not_limit)
lsl limit, tmp1, #3 /* Bits -> bytes. */
mov mask, #~0
lsr mask, mask, limit
bic data1, data1, mask
bic data2, data2, mask
/* Make sure that the NUL byte is marked in the syndrome. */
orr has_nul, has_nul, mask
L(not_limit):
/* For b... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/aarch64/strncmp.S | 121 | 180 |
bminor/glibc:sysdeps/aarch64/strncmp.S:5 | lsl data2, data2, pos
/* But we need to zero-extend (char is unsigned) the value and then
perform a signed 32-bit subtraction. */
lsr data1, data1, #56
sub result, data1, data2, lsr #56
ret
#endif
L(mutual_align):
/* Sources are mutually aligned, but are not currently at an
alignment boundary. Round dow... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/aarch64/strncmp.S | 161 | 220 |
bminor/glibc:sysdeps/aarch64/strncmp.S:6 | ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */
b.eq L(byte_loop)
L(done):
sub result, data1, data2
ret
/* Align the SRC1 to a dword by doing a bytewise compare and then do
the dword loop. */
L(try_misaligned_words):
cbz count, L(src1_aligned)
neg count, count
and count, count, #7
sub limit, limit, coun... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/aarch64/strncmp.S | 201 | 260 |
bminor/glibc:sysdeps/aarch64/strncmp.S:7 | lsl offset, src2, #3
bic src2, src2, #0xf
mov mask, -1
neg neg_offset, offset
ldr data1, [src1], #8
ldp tmp1, tmp2, [src2], #16
LS_BK mask, mask, neg_offset
and neg_offset, neg_offset, #63 /* Need actual value for cmp later. */
/* Skip the first compare if data in tmp1 is irrelevant. */
tbnz offset, 6, L(misal... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/aarch64/strncmp.S | 241 | 300 |
bminor/glibc:sysdeps/aarch64/strncmp.S:8 | eor diff, data2, data1 /* Non-zero if differences found. */
bic has_nul, has_nul, tmp3 /* Non-zero if NUL terminator. */
#ifdef __AARCH64EB__
rev has_nul, has_nul
#endif
cmp limit, neg_offset, lsr #3
orr syndrome, diff, has_nul
bic syndrome, syndrome, mask /* Ignore later bytes. */
csinv tmp3, syndrome, xzr, hi... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/aarch64/strncmp.S | 281 | 318 |
bminor/glibc:sysdeps/aarch64/strncmp.S:1 | /* Copyright (C) 2013-2025 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 2642002380aafb71a1d3b569b6d7ebeab3284816 | github | libc | https://github.com/bminor/glibc/blob/2642002380aafb71a1d3b569b6d7ebeab3284816/sysdeps/aarch64/strncmp.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strncmp.S:1 | /* Copyright (C) 2013-2024 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | dff8da6b3e89b986bb7f6b1ec18cf65d5972e307 | github | libc | https://github.com/bminor/glibc/blob/dff8da6b3e89b986bb7f6b1ec18cf65d5972e307/sysdeps/aarch64/strncmp.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strncmp.S:1 | /* Copyright (C) 2013-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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 6d7e8eda9b85b08f207a6dc6f187e94e4817270f | github | libc | https://github.com/bminor/glibc/blob/6d7e8eda9b85b08f207a6dc6f187e94e4817270f/sysdeps/aarch64/strncmp.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strncmp.S:1 | /* Copyright (C) 2013-2022 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 581c785bf31bc74430320c7856bbfa3875d025fe | github | libc | https://github.com/bminor/glibc/blob/581c785bf31bc74430320c7856bbfa3875d025fe/sysdeps/aarch64/strncmp.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strncmp.S:1 | /* Copyright (C) 2013-2021 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/aarch64/strncmp.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strncmp.S:1 | /* Copyright (C) 2013-2020 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 03e1378f94173fc192a81e421457198f7b8a34a0 | github | libc | https://github.com/bminor/glibc/blob/03e1378f94173fc192a81e421457198f7b8a34a0/sysdeps/aarch64/strncmp.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strncmp.S:1 | /* Copyright (C) 2013-2020 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | d614a7539657941a9201c236b2f15afac18e1213 | github | libc | https://github.com/bminor/glibc/blob/d614a7539657941a9201c236b2f15afac18e1213/sysdeps/aarch64/strncmp.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strncmp.S:2 | #define has_nul x5
#define diff x6
#define syndrome x7
#define tmp1 x8
#define tmp2 x9
#define tmp3 x10
#define zeroones x11
#define pos x12
#define limit_wd x13
#define mask x14
#define endloop x15
#define count mask
ENTRY_ALIGN_AND_PAD (strncmp, 6, 7)
DELOUSE (0)
DELOUSE (1)
DELOUSE (2)
cbz limit, L(ret... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | d614a7539657941a9201c236b2f15afac18e1213 | github | libc | https://github.com/bminor/glibc/blob/d614a7539657941a9201c236b2f15afac18e1213/sysdeps/aarch64/strncmp.S | 41 | 100 |
bminor/glibc:sysdeps/aarch64/strncmp.S:3 | csinv endloop, diff, xzr, pl /* Last Dword or differences. */
bics has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */
ccmp endloop, #0, #0, eq
b.eq L(loop_aligned)
/* End of performance-critical section -- one 64B cache line. */
/* Not reached the limit, must have found the end or a diff. */
tbz limit_wd... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | d614a7539657941a9201c236b2f15afac18e1213 | github | libc | https://github.com/bminor/glibc/blob/d614a7539657941a9201c236b2f15afac18e1213/sysdeps/aarch64/strncmp.S | 81 | 140 |
bminor/glibc:sysdeps/aarch64/strncmp.S:4 | /* But we need to zero-extend (char is unsigned) the value and then
perform a signed 32-bit subtraction. */
lsr data1, data1, #56
sub result, data1, data2, lsr #56
RET
#else
/* For big-endian we cannot use the trick with the syndrome value
as carry-propagation can corrupt the upper bits if the trailing
... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | d614a7539657941a9201c236b2f15afac18e1213 | github | libc | https://github.com/bminor/glibc/blob/d614a7539657941a9201c236b2f15afac18e1213/sysdeps/aarch64/strncmp.S | 121 | 180 |
bminor/glibc:sysdeps/aarch64/strncmp.S:5 | /* Sources are mutually aligned, but are not currently at an
alignment boundary. Round down the addresses and then mask off
the bytes that precede the start point.
We also need to adjust the limit calculations, but without
overflowing if the limit is near ULONG_MAX. */
bic src1, src1, #7
bic src2, s... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | d614a7539657941a9201c236b2f15afac18e1213 | github | libc | https://github.com/bminor/glibc/blob/d614a7539657941a9201c236b2f15afac18e1213/sysdeps/aarch64/strncmp.S | 161 | 220 |
bminor/glibc:sysdeps/aarch64/strncmp.S:6 | ccmp data1w, #1, #0, hi /* NZCV = 0b0000. */
ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */
b.eq L(byte_loop)
L(done):
sub result, data1, data2
RET
/* Align the SRC1 to a dword by doing a bytewise compare and then do
the dword loop. */
L(try_misaligned_words):
lsr limit_wd, limit, #3
cbz count, L(do_mi... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | d614a7539657941a9201c236b2f15afac18e1213 | github | libc | https://github.com/bminor/glibc/blob/d614a7539657941a9201c236b2f15afac18e1213/sysdeps/aarch64/strncmp.S | 201 | 260 |
bminor/glibc:sysdeps/aarch64/strncmp.S:7 | ldr data2, [src2], #8
sub tmp1, data1, zeroones
orr tmp2, data1, #REP8_7f
eor diff, data1, data2 /* Non-zero if differences found. */
bics has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */
ccmp diff, #0, #0, eq
b.ne L(not_limit)
subs limit_wd, limit_wd, #1
b.pl L(loop_misaligned)
L(done_loop):
/* We fou... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | d614a7539657941a9201c236b2f15afac18e1213 | github | libc | https://github.com/bminor/glibc/blob/d614a7539657941a9201c236b2f15afac18e1213/sysdeps/aarch64/strncmp.S | 241 | 272 |
bminor/glibc:sysdeps/aarch64/strncmp.S:1 | /* Copyright (C) 2013-2019 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 5a82c74822d3272df2f5929133680478c0cfb4bd | github | libc | https://github.com/bminor/glibc/blob/5a82c74822d3272df2f5929133680478c0cfb4bd/sysdeps/aarch64/strncmp.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strncmp.S:1 | /* Copyright (C) 2013-2019 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 04277e02d7f54d3582bebcf8386b317018cd5e1d | github | libc | https://github.com/bminor/glibc/blob/04277e02d7f54d3582bebcf8386b317018cd5e1d/sysdeps/aarch64/strncmp.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strncmp.S:1 | /* Copyright (C) 2013-2018 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | b47c3e7637efb77818cbef55dcd0ed1f0ea0ddf1 | github | libc | https://github.com/bminor/glibc/blob/b47c3e7637efb77818cbef55dcd0ed1f0ea0ddf1/sysdeps/aarch64/strncmp.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strncmp.S:5 | /* Sources are mutually aligned, but are not currently at an
alignment boundary. Round down the addresses and then mask off
the bytes that precede the start point.
We also need to adjust the limit calculations, but without
overflowing if the limit is near ULONG_MAX. */
bic src1, src1, #7
bic src2, s... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | d46f84de745db8f3f06a37048261f4e5ceacf0a3 | github | libc | https://github.com/bminor/glibc/blob/d46f84de745db8f3f06a37048261f4e5ceacf0a3/sysdeps/aarch64/strncmp.S | 161 | 220 |
bminor/glibc:sysdeps/aarch64/strncmp.S:6 | ccmp data1w, #1, #0, hi /* NZCV = 0b0000. */
ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */
b.eq L(byte_loop)
L(done):
sub result, data1, data2
RET
/* Align the SRC1 to a dword by doing a bytewise compare and then do
the dword loop. */
L(try_misaligned_words):
mov limit_wd, limit
lsr limit_wd, limit_wd... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | d46f84de745db8f3f06a37048261f4e5ceacf0a3 | github | libc | https://github.com/bminor/glibc/blob/d46f84de745db8f3f06a37048261f4e5ceacf0a3/sysdeps/aarch64/strncmp.S | 201 | 260 |
bminor/glibc:sysdeps/aarch64/strncmp.S:7 | ldr data1, [src1], #8
ldr data2, [src2], #8
sub tmp1, data1, zeroones
orr tmp2, data1, #REP8_7f
eor diff, data1, data2 /* Non-zero if differences found. */
bics has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */
ccmp diff, #0, #0, eq
b.ne L(not_limit)
subs limit_wd, limit_wd, #1
b.pl L(loop_misaligned)
L... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | d46f84de745db8f3f06a37048261f4e5ceacf0a3 | github | libc | https://github.com/bminor/glibc/blob/d46f84de745db8f3f06a37048261f4e5ceacf0a3/sysdeps/aarch64/strncmp.S | 241 | 274 |
bminor/glibc:sysdeps/aarch64/strncmp.S:5 | /* Sources are mutually aligned, but are not currently at an
alignment boundary. Round down the addresses and then mask off
the bytes that precede the start point.
We also need to adjust the limit calculations, but without
overflowing if the limit is near ULONG_MAX. */
bic src1, src1, #7
bic src2, s... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 7108f1f944792ac68332967015d5e6418c5ccc88 | github | libc | https://github.com/bminor/glibc/blob/7108f1f944792ac68332967015d5e6418c5ccc88/sysdeps/aarch64/strncmp.S | 161 | 220 |
bminor/glibc:sysdeps/aarch64/strncmp.S:6 | ccmp data1w, #1, #0, hi /* NZCV = 0b0000. */
ccmp data1w, data2w, #0, cs /* NZCV = 0b0000. */
b.eq L(byte_loop)
L(done):
sub result, data1, data2
RET
/* Align the SRC1 to a dword by doing a bytewise compare and then do
the dword loop. */
L(try_misaligned_words):
mov limit_wd, limit, lsr #3
cbz count, L(d... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 7108f1f944792ac68332967015d5e6418c5ccc88 | github | libc | https://github.com/bminor/glibc/blob/7108f1f944792ac68332967015d5e6418c5ccc88/sysdeps/aarch64/strncmp.S | 201 | 260 |
bminor/glibc:sysdeps/aarch64/strncmp.S:1 | /* Copyright (C) 2013-2018 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 688903eb3ef01301d239ab753d309d45720610a7 | github | libc | https://github.com/bminor/glibc/blob/688903eb3ef01301d239ab753d309d45720610a7/sysdeps/aarch64/strncmp.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strncmp.S:2 | #define has_nul x5
#define diff x6
#define syndrome x7
#define tmp1 x8
#define tmp2 x9
#define tmp3 x10
#define zeroones x11
#define pos x12
#define limit_wd x13
#define mask x14
#define endloop x15
ENTRY_ALIGN_AND_PAD (strncmp, 6, 7)
DELOUSE (0)
DELOUSE (1)
DELOUSE (2)
cbz limit, L(ret0)
eor tmp1, src1, ... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 688903eb3ef01301d239ab753d309d45720610a7 | github | libc | https://github.com/bminor/glibc/blob/688903eb3ef01301d239ab753d309d45720610a7/sysdeps/aarch64/strncmp.S | 41 | 100 |
bminor/glibc:sysdeps/aarch64/strncmp.S:3 | bics has_nul, tmp1, tmp2 /* Non-zero if NUL terminator. */
ccmp endloop, #0, #0, eq
b.eq L(loop_aligned)
/* End of performance-critical section -- one 64B cache line. */
/* Not reached the limit, must have found the end or a diff. */
tbz limit_wd, #63, L(not_limit)
/* Limit % 8 == 0 => all bytes significant... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 688903eb3ef01301d239ab753d309d45720610a7 | github | libc | https://github.com/bminor/glibc/blob/688903eb3ef01301d239ab753d309d45720610a7/sysdeps/aarch64/strncmp.S | 81 | 140 |
bminor/glibc:sysdeps/aarch64/strncmp.S:4 | perform a signed 32-bit subtraction. */
lsr data1, data1, #56
sub result, data1, data2, lsr #56
RET
#else
/* For big-endian we cannot use the trick with the syndrome value
as carry-propagation can corrupt the upper bits if the trailing
bytes in the string contain 0x01. */
/* However, if there is no NUL b... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 688903eb3ef01301d239ab753d309d45720610a7 | github | libc | https://github.com/bminor/glibc/blob/688903eb3ef01301d239ab753d309d45720610a7/sysdeps/aarch64/strncmp.S | 121 | 180 |
bminor/glibc:sysdeps/aarch64/strncmp.S:5 | alignment boundary. Round down the addresses and then mask off
the bytes that precede the start point.
We also need to adjust the limit calculations, but without
overflowing if the limit is near ULONG_MAX. */
bic src1, src1, #7
bic src2, src2, #7
ldr data1, [src1], #8
neg tmp3, tmp1, lsl #3 /* 64 - bi... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 688903eb3ef01301d239ab753d309d45720610a7 | github | libc | https://github.com/bminor/glibc/blob/688903eb3ef01301d239ab753d309d45720610a7/sysdeps/aarch64/strncmp.S | 161 | 207 |
bminor/glibc:sysdeps/aarch64/strncmp.S:1 | /* Copyright (C) 2013-2017 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | bfff8b1becd7d01c074177df7196ab327cd8c844 | github | libc | https://github.com/bminor/glibc/blob/bfff8b1becd7d01c074177df7196ab327cd8c844/sysdeps/aarch64/strncmp.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strncmp.S:1 | /* Copyright (C) 2013-2016 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | 389d1f1b232b3d6b9d73ee2c50e543ace6675621 | github | libc | https://github.com/bminor/glibc/blob/389d1f1b232b3d6b9d73ee2c50e543ace6675621/sysdeps/aarch64/strncmp.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strncmp.S:1 | /* Copyright (C) 2013-2016 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... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | f7a9f785e547bd599dee496fd906a28bcb4ec7fe | github | libc | https://github.com/bminor/glibc/blob/f7a9f785e547bd599dee496fd906a28bcb4ec7fe/sysdeps/aarch64/strncmp.S | 1 | 60 |
bminor/glibc:sysdeps/aarch64/strncmp.S:2 | #define has_nul x5
#define diff x6
#define syndrome x7
#define tmp1 x8
#define tmp2 x9
#define tmp3 x10
#define zeroones x11
#define pos x12
#define limit_wd x13
#define mask x14
#define endloop x15
ENTRY_ALIGN_AND_PAD (strncmp, 6, 7)
cbz limit, L(ret0)
eor tmp1, src1, src2
mov zeroones, #REP8_01
tst tmp1,... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | f7a9f785e547bd599dee496fd906a28bcb4ec7fe | github | libc | https://github.com/bminor/glibc/blob/f7a9f785e547bd599dee496fd906a28bcb4ec7fe/sysdeps/aarch64/strncmp.S | 41 | 100 |
bminor/glibc:sysdeps/aarch64/strncmp.S:3 | /* End of performance-critical section -- one 64B cache line. */
/* Not reached the limit, must have found the end or a diff. */
tbz limit_wd, #63, L(not_limit)
/* Limit % 8 == 0 => all bytes significant. */
ands limit, limit, #7
b.eq L(not_limit)
lsl limit, limit, #3 /* Bits -> bytes. */
mov mask, #~0
#... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | f7a9f785e547bd599dee496fd906a28bcb4ec7fe | github | libc | https://github.com/bminor/glibc/blob/f7a9f785e547bd599dee496fd906a28bcb4ec7fe/sysdeps/aarch64/strncmp.S | 81 | 140 |
bminor/glibc:sysdeps/aarch64/strncmp.S:4 | RET
#else
/* For big-endian we cannot use the trick with the syndrome value
as carry-propagation can corrupt the upper bits if the trailing
bytes in the string contain 0x01. */
/* However, if there is no NUL byte in the dword, we can generate
the result directly. We can't just subtract the bytes as the
... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | f7a9f785e547bd599dee496fd906a28bcb4ec7fe | github | libc | https://github.com/bminor/glibc/blob/f7a9f785e547bd599dee496fd906a28bcb4ec7fe/sysdeps/aarch64/strncmp.S | 121 | 180 |
bminor/glibc:sysdeps/aarch64/strncmp.S:5 | overflowing if the limit is near ULONG_MAX. */
bic src1, src1, #7
bic src2, src2, #7
ldr data1, [src1], #8
neg tmp3, tmp1, lsl #3 /* 64 - bits(bytes beyond align). */
ldr data2, [src2], #8
mov tmp2, #~0
sub limit_wd, limit, #1 /* limit != 0, so no underflow. */
#ifdef __AARCH64EB__
/* Big-endian. Early bytes... | arm64 | gas-like | handwritten | bminor/glibc | sysdeps/aarch64/strncmp.S | LGPL-2.1 | f7a9f785e547bd599dee496fd906a28bcb4ec7fe | github | libc | https://github.com/bminor/glibc/blob/f7a9f785e547bd599dee496fd906a28bcb4ec7fe/sysdeps/aarch64/strncmp.S | 161 | 204 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.