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/i386/stpcpy.S:1 | /* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 ... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpcpy.S | LGPL-2.1 | 6d7e8eda9b85b08f207a6dc6f187e94e4817270f | github | libc | https://github.com/bminor/glibc/blob/6d7e8eda9b85b08f207a6dc6f187e94e4817270f/sysdeps/i386/stpcpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpcpy.S:1 | /* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 ... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpcpy.S | LGPL-2.1 | 581c785bf31bc74430320c7856bbfa3875d025fe | github | libc | https://github.com/bminor/glibc/blob/581c785bf31bc74430320c7856bbfa3875d025fe/sysdeps/i386/stpcpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpcpy.S:1 | /* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 ... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpcpy.S | LGPL-2.1 | 30891f35fa7da832b66d80d0807610df361851f3 | github | libc | https://github.com/bminor/glibc/blob/30891f35fa7da832b66d80d0807610df361851f3/sysdeps/i386/stpcpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpcpy.S:1 | /* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-2021 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper (drepper@gnu.ai.mit.edu).
The GNU C Library is free software; you can redistribut... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpcpy.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/stpcpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpcpy.S:1 | /* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-2020 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper (drepper@gnu.ai.mit.edu).
The GNU C Library is free software; you can redistribut... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpcpy.S | LGPL-2.1 | d614a7539657941a9201c236b2f15afac18e1213 | github | libc | https://github.com/bminor/glibc/blob/d614a7539657941a9201c236b2f15afac18e1213/sysdeps/i386/stpcpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpcpy.S:1 | /* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper (drepper@gnu.ai.mit.edu).
The GNU C Library is free software; you can redistribut... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpcpy.S | LGPL-2.1 | 5a82c74822d3272df2f5929133680478c0cfb4bd | github | libc | https://github.com/bminor/glibc/blob/5a82c74822d3272df2f5929133680478c0cfb4bd/sysdeps/i386/stpcpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpcpy.S:1 | /* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper (drepper@gnu.ai.mit.edu).
The GNU C Library is free software; you can redistribut... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpcpy.S | LGPL-2.1 | 04277e02d7f54d3582bebcf8386b317018cd5e1d | github | libc | https://github.com/bminor/glibc/blob/04277e02d7f54d3582bebcf8386b317018cd5e1d/sysdeps/i386/stpcpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpcpy.S:1 | /* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper (drepper@gnu.ai.mit.edu).
The GNU C Library is free software; you can redistribut... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpcpy.S | LGPL-2.1 | 688903eb3ef01301d239ab753d309d45720610a7 | github | libc | https://github.com/bminor/glibc/blob/688903eb3ef01301d239ab753d309d45720610a7/sysdeps/i386/stpcpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpcpy.S:1 | /* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper (drepper@gnu.ai.mit.edu).
The GNU C Library is free software; you can redistribut... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpcpy.S | LGPL-2.1 | bfff8b1becd7d01c074177df7196ab327cd8c844 | github | libc | https://github.com/bminor/glibc/blob/bfff8b1becd7d01c074177df7196ab327cd8c844/sysdeps/i386/stpcpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpcpy.S:1 | /* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper (drepper@gnu.ai.mit.edu).
The GNU C Library is free software; you can redistribut... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpcpy.S | LGPL-2.1 | f7a9f785e547bd599dee496fd906a28bcb4ec7fe | github | libc | https://github.com/bminor/glibc/blob/f7a9f785e547bd599dee496fd906a28bcb4ec7fe/sysdeps/i386/stpcpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpcpy.S:1 | /* Copy SRC to DEST returning the address of the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper (drepper@gnu.ai.mit.edu).
The GNU C Library is free software; you can redistribut... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpcpy.S | LGPL-2.1 | 890b7a4b33d482b5c768ab47d70758b80227e9bc | github | libc | https://github.com/bminor/glibc/blob/890b7a4b33d482b5c768ab47d70758b80227e9bc/sysdeps/i386/stpcpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpncpy.S:1 | /* copy no more than N bytes from SRC to DEST, returning the address of
the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 unde... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/stpncpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpncpy.S:2 | subl %eax, %esi /* magic: reduce number of loop variants
to one using addressing mode */
jmp L(1) /* jump to loop "head" */
ALIGN(4)
/* Four times unfolded loop with two loop counters. We get the
third value (the source address) by using the index+base
addressing mode. */
L(2): movb (%eax,%esi),... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/stpncpy.S | 41 | 100 |
bminor/glibc:sysdeps/i386/stpncpy.S:3 | movb %dl, (%eax) /* and store it */
testb %dl, %dl /* was it NUL? */
jz L(3) /* yes, then exit */
incl %eax /* increment pointer */
decl %ecx /* decrement length counter */
jz L(9) /* no more allowed => exit */
movb (%eax,%esi), %dl /* load current char */
movb %dl, (%eax) /* and store it */
testb %dl,... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/stpncpy.S | 81 | 140 |
bminor/glibc:sysdeps/i386/stpncpy.S:4 | and not 4? Very simple, we have to count
the NUL char we already wrote. */
jz L(9) /* counter is also 0 => exit */
/* We now have to fill the rest of the buffer with NUL. This
is done in a tricky way. Please note that the addressing mode
used below is not the same we used above. Here we use the... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/stpncpy.S | 121 | 144 |
bminor/glibc:sysdeps/i386/stpncpy.S:1 | /* copy no more than N bytes from SRC to DEST, returning the address of
the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 unde... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | 2642002380aafb71a1d3b569b6d7ebeab3284816 | github | libc | https://github.com/bminor/glibc/blob/2642002380aafb71a1d3b569b6d7ebeab3284816/sysdeps/i386/stpncpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpncpy.S:1 | /* copy no more than N bytes from SRC to DEST, returning the address of
the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 unde... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | 8428278b5f5cee21811339017ca09cccc8c751f7 | github | libc | https://github.com/bminor/glibc/blob/8428278b5f5cee21811339017ca09cccc8c751f7/sysdeps/i386/stpncpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpncpy.S:4 | and not 4? Very simple, we have to count
the NUL char we already wrote. */
jz L(9) /* counter is also 0 => exit */
/* We now have to fill the rest of the buffer with NUL. This
is done in a tricky way. Please note that the addressing mode
used below is not the same we used above. Here we use the... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | dff8da6b3e89b986bb7f6b1ec18cf65d5972e307 | github | libc | https://github.com/bminor/glibc/blob/dff8da6b3e89b986bb7f6b1ec18cf65d5972e307/sysdeps/i386/stpncpy.S | 121 | 142 |
bminor/glibc:sysdeps/i386/stpncpy.S:1 | /* copy no more than N bytes from SRC to DEST, returning the address of
the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 unde... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | 6d7e8eda9b85b08f207a6dc6f187e94e4817270f | github | libc | https://github.com/bminor/glibc/blob/6d7e8eda9b85b08f207a6dc6f187e94e4817270f/sysdeps/i386/stpncpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpncpy.S:1 | /* copy no more than N bytes from SRC to DEST, returning the address of
the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 unde... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | 581c785bf31bc74430320c7856bbfa3875d025fe | github | libc | https://github.com/bminor/glibc/blob/581c785bf31bc74430320c7856bbfa3875d025fe/sysdeps/i386/stpncpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpncpy.S:1 | /* copy no more than N bytes from SRC to DEST, returning the address of
the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 unde... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | 30891f35fa7da832b66d80d0807610df361851f3 | github | libc | https://github.com/bminor/glibc/blob/30891f35fa7da832b66d80d0807610df361851f3/sysdeps/i386/stpncpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpncpy.S:1 | /* copy no more than N bytes from SRC to DEST, returning the address of
the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-2021 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some bug fixes by Alan Modr... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/stpncpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpncpy.S:2 | movl DEST(%esp), %eax
movl SRC(%esp), %esi
cfi_rel_offset (esi, 0)
movl LEN(%esp), %ecx
subl %eax, %esi /* magic: reduce number of loop variants
to one using addressing mode */
jmp L(1) /* jump to loop "head" */
ALIGN(4)
/* Four times unfolded loop with two loop counters. We get the
third value ... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/stpncpy.S | 41 | 100 |
bminor/glibc:sysdeps/i386/stpncpy.S:3 | addl $4, %ecx /* correct above subtraction */
jz L(9) /* maximal allowed char reached => go to end */
movb (%eax,%esi), %dl /* load current char */
movb %dl, (%eax) /* and store it */
testb %dl, %dl /* was it NUL? */
jz L(3) /* yes, then exit */
incl %eax /* increment pointer */
decl %ecx /* decrement ... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/stpncpy.S | 81 | 140 |
bminor/glibc:sysdeps/i386/stpncpy.S:4 | incl %eax /* increment pointer */
L(7):
addl $3, %ecx /* correct pre-decrementation of counter
at the beginning of the loop; but why 3
and not 4? Very simple, we have to count
the NUL char we already wrote. */
jz L(9) /* counter is also 0 => exit */
/* We now have to fill the rest of the... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/stpncpy.S | 121 | 147 |
bminor/glibc:sysdeps/i386/stpncpy.S:1 | /* copy no more than N bytes from SRC to DEST, returning the address of
the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-2020 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some bug fixes by Alan Modr... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | d614a7539657941a9201c236b2f15afac18e1213 | github | libc | https://github.com/bminor/glibc/blob/d614a7539657941a9201c236b2f15afac18e1213/sysdeps/i386/stpncpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpncpy.S:1 | /* copy no more than N bytes from SRC to DEST, returning the address of
the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some bug fixes by Alan Modr... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | 5a82c74822d3272df2f5929133680478c0cfb4bd | github | libc | https://github.com/bminor/glibc/blob/5a82c74822d3272df2f5929133680478c0cfb4bd/sysdeps/i386/stpncpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpncpy.S:1 | /* copy no more than N bytes from SRC to DEST, returning the address of
the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some bug fixes by Alan Modr... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | 04277e02d7f54d3582bebcf8386b317018cd5e1d | github | libc | https://github.com/bminor/glibc/blob/04277e02d7f54d3582bebcf8386b317018cd5e1d/sysdeps/i386/stpncpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpncpy.S:1 | /* copy no more than N bytes from SRC to DEST, returning the address of
the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some bug fixes by Alan Modr... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | 688903eb3ef01301d239ab753d309d45720610a7 | github | libc | https://github.com/bminor/glibc/blob/688903eb3ef01301d239ab753d309d45720610a7/sysdeps/i386/stpncpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpncpy.S:1 | /* copy no more than N bytes from SRC to DEST, returning the address of
the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some bug fixes by Alan Modr... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | bfff8b1becd7d01c074177df7196ab327cd8c844 | github | libc | https://github.com/bminor/glibc/blob/bfff8b1becd7d01c074177df7196ab327cd8c844/sysdeps/i386/stpncpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpncpy.S:1 | /* copy no more than N bytes from SRC to DEST, returning the address of
the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some bug fixes by Alan Modr... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | f7a9f785e547bd599dee496fd906a28bcb4ec7fe | github | libc | https://github.com/bminor/glibc/blob/f7a9f785e547bd599dee496fd906a28bcb4ec7fe/sysdeps/i386/stpncpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/stpncpy.S:1 | /* copy no more than N bytes from SRC to DEST, returning the address of
the terminating '\0' in DEST.
For Intel 80x86, x>=3.
Copyright (C) 1994-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some bug fixes by Alan Modr... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/stpncpy.S | LGPL-2.1 | 890b7a4b33d482b5c768ab47d70758b80227e9bc | github | libc | https://github.com/bminor/glibc/blob/890b7a4b33d482b5c768ab47d70758b80227e9bc/sysdeps/i386/stpncpy.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strcat.S:1 | /* strcat(dest, src) -- Append SRC on the end of DEST.
For Intel 80x86, x>=4.
Copyright (C) 1994-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
Li... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strcat.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strcat.S:2 | testl $3, %edx /* destination pointer aligned? */
jz L(1) /* yes => begin scan loop */
testb $0xff, (%edx) /* is end of string? */
jz L(2) /* yes => start appending */
incl %edx /* increment source pointer */
testl $3, %edx /* destination pointer aligned? */
jz L(1) /* yes => begin scan loop */
testb $... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strcat.S | 41 | 100 |
bminor/glibc:sysdeps/i386/strcat.S:3 | following XOR would destroy the carry flag and it would (in a
representation with more than 32 bits) not alter then last
overflow, we can now test this condition. If no carry is signaled
no overflow must have occurred in the last byte => it was 0. */
jnc L(3)
/* We are only interested in carry bits that... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strcat.S | 81 | 140 |
bminor/glibc:sysdeps/i386/strcat.S:4 | jnz L(6) /* one byte is NUL => stop copying */
movl 12(%edx), %eax /* get word from source */
movl $0xfefefeff, %edi /* magic value */
addl %eax, %edi /* add the magic value to the word. We get
carry bits reported for each byte which
is *not* 0 */
jnc L(7) /* highest byte is C => stop copying */
... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strcat.S | 121 | 180 |
bminor/glibc:sysdeps/i386/strcat.S:5 | testl $3, %ecx /* pointer correctly aligned? */
jz L(29) /* yes => start copy loop */
movb (%ecx), %al /* get first byte */
movb %al, (%ecx,%edx) /* and store it */
andb %al, %al /* is byte NUL? */
jz L(8) /* yes => return */
incl %ecx /* increment pointer */
testl $3, %ecx /* pointer correctly aligned? ... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strcat.S | 161 | 220 |
bminor/glibc:sysdeps/i386/strcat.S:6 | addl %eax, %edi /* add the magic value to the word. We get
carry bits reported for each byte which
is *not* 0 */
jnc L(91) /* highest byte is C => stop copying */
xorl %eax, %edi /* ((word^charmask)+magic)^(word^charmask) */
orl $0xfefefeff, %edi /* set all non-carry bits */
incl %edi /* add 1: i... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strcat.S | 201 | 260 |
bminor/glibc:sysdeps/i386/strcat.S:7 | L(9): movb %al, (%ecx,%edx) /* store first byte of last word */
orb %al, %al /* is it NUL? */
jz L(8) /* yes => return */
movb %ah, 1(%ecx,%edx) /* store second byte of last word */
orb %ah, %ah /* is it NUL? */
jz L(8) /* yes => return */
shrl $16, %eax /* make upper bytes accessible */
movb %al, 2(%ec... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strcat.S | 241 | 263 |
bminor/glibc:sysdeps/i386/strcat.S:1 | /* strcat(dest, src) -- Append SRC on the end of DEST.
For Intel 80x86, x>=4.
Copyright (C) 1994-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
Li... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 2642002380aafb71a1d3b569b6d7ebeab3284816 | github | libc | https://github.com/bminor/glibc/blob/2642002380aafb71a1d3b569b6d7ebeab3284816/sysdeps/i386/strcat.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strcat.S:1 | /* strcat(dest, src) -- Append SRC on the end of DEST.
For Intel 80x86, x>=4.
Copyright (C) 1994-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
Li... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | dff8da6b3e89b986bb7f6b1ec18cf65d5972e307 | github | libc | https://github.com/bminor/glibc/blob/dff8da6b3e89b986bb7f6b1ec18cf65d5972e307/sysdeps/i386/strcat.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strcat.S:1 | /* strcat(dest, src) -- Append SRC on the end of DEST.
For Intel 80x86, x>=4.
Copyright (C) 1994-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
Li... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 6d7e8eda9b85b08f207a6dc6f187e94e4817270f | github | libc | https://github.com/bminor/glibc/blob/6d7e8eda9b85b08f207a6dc6f187e94e4817270f/sysdeps/i386/strcat.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strcat.S:1 | /* strcat(dest, src) -- Append SRC on the end of DEST.
For Intel 80x86, x>=4.
Copyright (C) 1994-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
Li... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 581c785bf31bc74430320c7856bbfa3875d025fe | github | libc | https://github.com/bminor/glibc/blob/581c785bf31bc74430320c7856bbfa3875d025fe/sysdeps/i386/strcat.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strcat.S:1 | /* strcat(dest, src) -- Append SRC on the end of DEST.
For Intel 80x86, x>=4.
Copyright (C) 1994-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
Li... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 30891f35fa7da832b66d80d0807610df361851f3 | github | libc | https://github.com/bminor/glibc/blob/30891f35fa7da832b66d80d0807610df361851f3/sysdeps/i386/strcat.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strcat.S:1 | /* strcat(dest, src) -- Append SRC on the end of DEST.
For Intel 80x86, x>=4.
Copyright (C) 1994-2021 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>.
Optimised a little by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/strcat.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strcat.S:2 | /* Test the first bytes separately until destination is aligned. */
testl $3, %edx /* destination pointer aligned? */
jz L(1) /* yes => begin scan loop */
testb $0xff, (%edx) /* is end of string? */
jz L(2) /* yes => start appending */
incl %edx /* increment source pointer */
testl $3, %edx /* destinatio... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/strcat.S | 41 | 100 |
bminor/glibc:sysdeps/i386/strcat.S:3 | /* According to the algorithm we had to reverse the effect of the
XOR first and then test the overflow bits. But because the
following XOR would destroy the carry flag and it would (in a
representation with more than 32 bits) not alter then last
overflow, we can now test this condition. If no carry is... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/strcat.S | 81 | 140 |
bminor/glibc:sysdeps/i386/strcat.S:4 | incl %edi /* add 1: if one carry bit was *not* set
the addition will not result in 0. */
jnz L(6) /* one byte is NUL => stop copying */
movl 12(%edx), %eax /* get word from source */
movl $0xfefefeff, %edi /* magic value */
addl %eax, %edi /* add the magic value to the word. We get
carry bits re... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/strcat.S | 121 | 180 |
bminor/glibc:sysdeps/i386/strcat.S:5 | jz L(8) /* yes => return */
incl %ecx /* increment pointer */
testl $3, %ecx /* pointer correctly aligned? */
jz L(29) /* yes => start copy loop */
movb (%ecx), %al /* get first byte */
movb %al, (%ecx,%edx) /* and store it */
andb %al, %al /* is byte NUL? */
jz L(8) /* yes => return */
incl %ecx /* i... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/strcat.S | 161 | 220 |
bminor/glibc:sysdeps/i386/strcat.S:6 | movl 4(%ecx), %eax /* get word from source */
movl $0xfefefeff, %edi /* magic value */
addl %eax, %edi /* add the magic value to the word. We get
carry bits reported for each byte which
is *not* 0 */
jnc L(91) /* highest byte is C => stop copying */
xorl %eax, %edi /* ((word^charmask)+magic)^(word... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/strcat.S | 201 | 260 |
bminor/glibc:sysdeps/i386/strcat.S:7 | L(91): addl $4, %ecx
L(9): movb %al, (%ecx,%edx) /* store first byte of last word */
orb %al, %al /* is it NUL? */
jz L(8) /* yes => return */
movb %ah, 1(%ecx,%edx) /* store second byte of last word */
orb %ah, %ah /* is it NUL? */
jz L(8) /* yes => return */
shrl $16, %eax /* make upper bytes accessib... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/strcat.S | 241 | 265 |
bminor/glibc:sysdeps/i386/strcat.S:1 | /* strcat(dest, src) -- Append SRC on the end of DEST.
For Intel 80x86, x>=4.
Copyright (C) 1994-2020 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>.
Optimised a little by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | d614a7539657941a9201c236b2f15afac18e1213 | github | libc | https://github.com/bminor/glibc/blob/d614a7539657941a9201c236b2f15afac18e1213/sysdeps/i386/strcat.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strcat.S:1 | /* strcat(dest, src) -- Append SRC on the end of DEST.
For Intel 80x86, x>=4.
Copyright (C) 1994-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>.
Optimised a little by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 5a82c74822d3272df2f5929133680478c0cfb4bd | github | libc | https://github.com/bminor/glibc/blob/5a82c74822d3272df2f5929133680478c0cfb4bd/sysdeps/i386/strcat.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strcat.S:1 | /* strcat(dest, src) -- Append SRC on the end of DEST.
For Intel 80x86, x>=4.
Copyright (C) 1994-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>.
Optimised a little by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 04277e02d7f54d3582bebcf8386b317018cd5e1d | github | libc | https://github.com/bminor/glibc/blob/04277e02d7f54d3582bebcf8386b317018cd5e1d/sysdeps/i386/strcat.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strcat.S:1 | /* strcat(dest, src) -- Append SRC on the end of DEST.
For Intel 80x86, x>=4.
Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>.
Optimised a little by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | 688903eb3ef01301d239ab753d309d45720610a7 | github | libc | https://github.com/bminor/glibc/blob/688903eb3ef01301d239ab753d309d45720610a7/sysdeps/i386/strcat.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strcat.S:1 | /* strcat(dest, src) -- Append SRC on the end of DEST.
For Intel 80x86, x>=4.
Copyright (C) 1994-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>.
Optimised a little by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | bfff8b1becd7d01c074177df7196ab327cd8c844 | github | libc | https://github.com/bminor/glibc/blob/bfff8b1becd7d01c074177df7196ab327cd8c844/sysdeps/i386/strcat.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strcat.S:1 | /* strcat(dest, src) -- Append SRC on the end of DEST.
For Intel 80x86, x>=4.
Copyright (C) 1994-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>.
Optimised a little by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au>
... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strcat.S | LGPL-2.1 | f7a9f785e547bd599dee496fd906a28bcb4ec7fe | github | libc | https://github.com/bminor/glibc/blob/f7a9f785e547bd599dee496fd906a28bcb4ec7fe/sysdeps/i386/strcat.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchr.S:1 | /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 Gen... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strchr.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchr.S:2 | movb %dl, %dh /* now it is 0|0|c|c */
movl %edx, %ecx
shll $16, %edx /* now it is c|c|0|0 */
movw %cx, %dx /* and finally c|c|c|c */
/* Before we start with the main loop we process single bytes
until the source pointer is aligned. This has two reasons:
1. aligned 32-bit memory access is faster
and... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strchr.S | 41 | 100 |
bminor/glibc:sysdeps/i386/strchr.S:3 | jz L(2) /* yes => return NULL */
incl %eax /* increment pointer */
/* No we have reached alignment. */
jmp L(11) /* begin loop */
/* We exit the loop if adding MAGIC_BITS to LONGWORD fails to
change any of the hole bits of LONGWORD.
1) Is this safe? Will it catch all the zero bytes?
Suppose ther... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strchr.S | 81 | 140 |
bminor/glibc:sysdeps/i386/strchr.S:4 | are now 0 */
movl $0xfefefeff, %edi /* magic value */
addl %ecx, %edi /* add the magic value to the word. We get
carry bits reported for each byte which
is *not* C */
/* According to the algorithm we had to reverse the effect of the
XOR first and then test the overflow bits. But because the
... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strchr.S | 121 | 180 |
bminor/glibc:sysdeps/i386/strchr.S:5 | jnz L(2) /* found NUL => return NULL */
movl 4(%eax), %ecx /* get word (= 4 bytes) in question */
xorl %edx, %ecx /* XOR with word c|c|c|c => bytes of str == c
are now 0 */
movl $0xfefefeff, %edi /* magic value */
addl %ecx, %edi /* add the magic value to the word. We get
carry bits reported for ... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strchr.S | 161 | 220 |
bminor/glibc:sysdeps/i386/strchr.S:6 | xorl %edx, %ecx /* restore original dword without reload */
movl $0xfefefeff, %edi /* magic value */
addl %ecx, %edi /* add the magic value to the word. We get
carry bits reported for each byte which
is *not* 0 */
jnc L(2) /* highest byte is NUL => return NULL */
xorl %ecx, %edi /* (word+magic)^w... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strchr.S | 201 | 260 |
bminor/glibc:sysdeps/i386/strchr.S:7 | cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
ret
cfi_adjust_cfa_offset (4)
cfi_rel_offset (edi, 0)
L(73): addl $4, %eax /* adjust pointer */
L(72): addl $4, %eax
L(71): addl $4, %eax
/* We now scan for the byte in which the character was matched.
But we have to take care of the case that a NUL char is
... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strchr.S | 241 | 288 |
bminor/glibc:sysdeps/i386/strchr.S:1 | /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 Gen... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 2642002380aafb71a1d3b569b6d7ebeab3284816 | github | libc | https://github.com/bminor/glibc/blob/2642002380aafb71a1d3b569b6d7ebeab3284816/sysdeps/i386/strchr.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchr.S:1 | /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 Gen... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | dff8da6b3e89b986bb7f6b1ec18cf65d5972e307 | github | libc | https://github.com/bminor/glibc/blob/dff8da6b3e89b986bb7f6b1ec18cf65d5972e307/sysdeps/i386/strchr.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchr.S:1 | /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 Gen... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 6d7e8eda9b85b08f207a6dc6f187e94e4817270f | github | libc | https://github.com/bminor/glibc/blob/6d7e8eda9b85b08f207a6dc6f187e94e4817270f/sysdeps/i386/strchr.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchr.S:1 | /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 Gen... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 581c785bf31bc74430320c7856bbfa3875d025fe | github | libc | https://github.com/bminor/glibc/blob/581c785bf31bc74430320c7856bbfa3875d025fe/sysdeps/i386/strchr.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchr.S:1 | /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 Gen... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 30891f35fa7da832b66d80d0807610df361851f3 | github | libc | https://github.com/bminor/glibc/blob/30891f35fa7da832b66d80d0807610df361851f3/sysdeps/i386/strchr.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchr.S:1 | /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Intel 80x86, x>=3.
Copyright (C) 1994-2021 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some optimisations by Alan Modra <Alan@SPRI.Levels.UniSA.Edu... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/strchr.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchr.S:2 | operations on 16 bit words because these require an
prefix byte (and one more cycle). */
movb %dl, %dh /* now it is 0|0|c|c */
movl %edx, %ecx
shll $16, %edx /* now it is c|c|0|0 */
movw %cx, %dx /* and finally c|c|c|c */
/* Before we start with the main loop we process single bytes
until the source p... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/strchr.S | 41 | 100 |
bminor/glibc:sysdeps/i386/strchr.S:3 | je L(6) /* target found => return */
testb %cl, %cl /* is NUL? */
jz L(2) /* yes => return NULL */
incl %eax /* increment pointer */
/* No we have reached alignment. */
jmp L(11) /* begin loop */
/* We exit the loop if adding MAGIC_BITS to LONGWORD fails to
change any of the hole bits of LONGWORD... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/strchr.S | 81 | 140 |
bminor/glibc:sysdeps/i386/strchr.S:4 | L(11): movl (%eax), %ecx /* get word (= 4 bytes) in question */
xorl %edx, %ecx /* XOR with word c|c|c|c => bytes of str == c
are now 0 */
movl $0xfefefeff, %edi /* magic value */
addl %ecx, %edi /* add the magic value to the word. We get
carry bits reported for each byte which
is *not* C */
... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/strchr.S | 121 | 180 |
bminor/glibc:sysdeps/i386/strchr.S:5 | incl %edi /* add 1: if one carry bit was *not* set
the addition will not result in 0. */
jnz L(2) /* found NUL => return NULL */
movl 4(%eax), %ecx /* get word (= 4 bytes) in question */
xorl %edx, %ecx /* XOR with word c|c|c|c => bytes of str == c
are now 0 */
movl $0xfefefeff, %edi /* magic val... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/strchr.S | 161 | 220 |
bminor/glibc:sysdeps/i386/strchr.S:6 | the addition will not result in 0. */
jnz L(72) /* found it => return pointer */
xorl %edx, %ecx /* restore original dword without reload */
movl $0xfefefeff, %edi /* magic value */
addl %ecx, %edi /* add the magic value to the word. We get
carry bits reported for each byte which
is *not* 0 */
j... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/strchr.S | 201 | 260 |
bminor/glibc:sysdeps/i386/strchr.S:7 | xorl %eax, %eax
popl %edi /* restore saved register content */
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
ret
cfi_adjust_cfa_offset (4)
cfi_rel_offset (edi, 0)
L(73): addl $4, %eax /* adjust pointer */
L(72): addl $4, %eax
L(71): addl $4, %eax
/* We now scan for the byte in which the character was matched... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/strchr.S | 241 | 290 |
bminor/glibc:sysdeps/i386/strchr.S:8 | L(6):
popl %edi /* restore saved register content */
cfi_adjust_cfa_offset (-4)
cfi_restore (edi)
ret
END (strchr)
weak_alias (strchr, index)
libc_hidden_builtin_def (strchr) | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/strchr.S | 281 | 290 |
bminor/glibc:sysdeps/i386/strchr.S:1 | /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Intel 80x86, x>=3.
Copyright (C) 1994-2020 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some optimisations by Alan Modra <Alan@SPRI.Levels.UniSA.Edu... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | d614a7539657941a9201c236b2f15afac18e1213 | github | libc | https://github.com/bminor/glibc/blob/d614a7539657941a9201c236b2f15afac18e1213/sysdeps/i386/strchr.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchr.S:1 | /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Intel 80x86, x>=3.
Copyright (C) 1994-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some optimisations by Alan Modra <Alan@SPRI.Levels.UniSA.Edu... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 5a82c74822d3272df2f5929133680478c0cfb4bd | github | libc | https://github.com/bminor/glibc/blob/5a82c74822d3272df2f5929133680478c0cfb4bd/sysdeps/i386/strchr.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchr.S:1 | /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Intel 80x86, x>=3.
Copyright (C) 1994-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some optimisations by Alan Modra <Alan@SPRI.Levels.UniSA.Edu... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 04277e02d7f54d3582bebcf8386b317018cd5e1d | github | libc | https://github.com/bminor/glibc/blob/04277e02d7f54d3582bebcf8386b317018cd5e1d/sysdeps/i386/strchr.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchr.S:1 | /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Intel 80x86, x>=3.
Copyright (C) 1994-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some optimisations by Alan Modra <Alan@SPRI.Levels.UniSA.Edu... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 688903eb3ef01301d239ab753d309d45720610a7 | github | libc | https://github.com/bminor/glibc/blob/688903eb3ef01301d239ab753d309d45720610a7/sysdeps/i386/strchr.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchr.S:1 | /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Intel 80x86, x>=3.
Copyright (C) 1994-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some optimisations by Alan Modra <Alan@SPRI.Levels.UniSA.Edu... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | bfff8b1becd7d01c074177df7196ab327cd8c844 | github | libc | https://github.com/bminor/glibc/blob/bfff8b1becd7d01c074177df7196ab327cd8c844/sysdeps/i386/strchr.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchr.S:1 | /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Intel 80x86, x>=3.
Copyright (C) 1994-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some optimisations by Alan Modra <Alan@SPRI.Levels.UniSA.Edu... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | f7a9f785e547bd599dee496fd906a28bcb4ec7fe | github | libc | https://github.com/bminor/glibc/blob/f7a9f785e547bd599dee496fd906a28bcb4ec7fe/sysdeps/i386/strchr.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchr.S:1 | /* strchr (str, ch) -- Return pointer to first occurrence of CH in STR.
For Intel 80x86, x>=3.
Copyright (C) 1994-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>
Some optimisations by Alan Modra <Alan@SPRI.Levels.UniSA.Edu... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchr.S | LGPL-2.1 | 890b7a4b33d482b5c768ab47d70758b80227e9bc | github | libc | https://github.com/bminor/glibc/blob/890b7a4b33d482b5c768ab47d70758b80227e9bc/sysdeps/i386/strchr.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchrnul.S:1 | /* strchrnul (str, chr) -- Return pointer to first occurrence of CHR in STR
or the final NUL byte.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 t... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchrnul.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strchrnul.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchrnul.S:2 | operations on 16 bit words because these require an
prefix byte (and one more cycle). */
movb %dl, %dh /* now it is 0|0|c|c */
movl %edx, %ecx
shll $16, %edx /* now it is c|c|0|0 */
movw %cx, %dx /* and finally c|c|c|c */
/* Before we start with the main loop we process single bytes
until the source p... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchrnul.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strchrnul.S | 41 | 100 |
bminor/glibc:sysdeps/i386/strchrnul.S:3 | je L(6) /* target found => return */
testb %cl, %cl /* is NUL? */
jz L(6) /* yes => return NULL */
incl %eax /* increment pointer */
/* No we have reached alignment. */
jmp L(11) /* begin loop */
/* We exit the loop if adding MAGIC_BITS to LONGWORD fails to
change any of the hole bits of LONGWORD... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchrnul.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strchrnul.S | 81 | 140 |
bminor/glibc:sysdeps/i386/strchrnul.S:4 | L(11): movl (%eax), %ecx /* get word (= 4 bytes) in question */
xorl %edx, %ecx /* XOR with word c|c|c|c => bytes of str == c
are now 0 */
movl $0xfefefeff, %edi /* magic value */
addl %ecx, %edi /* add the magic value to the word. We get
carry bits reported for each byte which
is *not* CHR *... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchrnul.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strchrnul.S | 121 | 180 |
bminor/glibc:sysdeps/i386/strchrnul.S:5 | incl %edi /* add 1: if one carry bit was *not* set
the addition will not result in 0. */
jnz L(7) /* found NUL => return NULL */
movl 4(%eax), %ecx /* get word (= 4 bytes) in question */
xorl %edx, %ecx /* XOR with word c|c|c|c => bytes of str == c
are now 0 */
movl $0xfefefeff, %edi /* magic val... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchrnul.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strchrnul.S | 161 | 220 |
bminor/glibc:sysdeps/i386/strchrnul.S:6 | the addition will not result in 0. */
jnz L(72) /* found it => return pointer */
xorl %edx, %ecx /* restore original dword without reload */
movl $0xfefefeff, %edi /* magic value */
addl %ecx, %edi /* add the magic value to the word. We get
carry bits reported for each byte which
is *not* 0 */
j... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchrnul.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strchrnul.S | 201 | 260 |
bminor/glibc:sysdeps/i386/strchrnul.S:7 | L(72): addl $4, %eax
L(71): addl $4, %eax
/* We now scan for the byte in which the character was matched.
But we have to take care of the case that a NUL char is
found before this in the dword. */
L(7): testb %cl, %cl /* is first byte CHR? */
jz L(6) /* yes => return pointer */
cmpb %dl, %cl /* is fir... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchrnul.S | LGPL-2.1 | 04e750e75b73957cf1c791535a3f4319534a52fc | github | libc | https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/sysdeps/i386/strchrnul.S | 241 | 277 |
bminor/glibc:sysdeps/i386/strchrnul.S:1 | /* strchrnul (str, chr) -- Return pointer to first occurrence of CHR in STR
or the final NUL byte.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 t... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchrnul.S | LGPL-2.1 | 2642002380aafb71a1d3b569b6d7ebeab3284816 | github | libc | https://github.com/bminor/glibc/blob/2642002380aafb71a1d3b569b6d7ebeab3284816/sysdeps/i386/strchrnul.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchrnul.S:1 | /* strchrnul (str, chr) -- Return pointer to first occurrence of CHR in STR
or the final NUL byte.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 t... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchrnul.S | LGPL-2.1 | dff8da6b3e89b986bb7f6b1ec18cf65d5972e307 | github | libc | https://github.com/bminor/glibc/blob/dff8da6b3e89b986bb7f6b1ec18cf65d5972e307/sysdeps/i386/strchrnul.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchrnul.S:1 | /* strchrnul (str, chr) -- Return pointer to first occurrence of CHR in STR
or the final NUL byte.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 t... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchrnul.S | LGPL-2.1 | 7ea510127e2067efa07865158ac92c330c379950 | github | libc | https://github.com/bminor/glibc/blob/7ea510127e2067efa07865158ac92c330c379950/sysdeps/i386/strchrnul.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchrnul.S:7 | L(72): addl $4, %eax
L(71): addl $4, %eax
/* We now scan for the byte in which the character was matched.
But we have to take care of the case that a NUL char is
found before this in the dword. */
L(7): testb %cl, %cl /* is first byte CHR? */
jz L(6) /* yes => return pointer */
cmpb %dl, %cl /* is fir... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchrnul.S | LGPL-2.1 | 6d7e8eda9b85b08f207a6dc6f187e94e4817270f | github | libc | https://github.com/bminor/glibc/blob/6d7e8eda9b85b08f207a6dc6f187e94e4817270f/sysdeps/i386/strchrnul.S | 241 | 276 |
bminor/glibc:sysdeps/i386/strchrnul.S:1 | /* strchrnul (str, chr) -- Return pointer to first occurrence of CHR in STR
or the final NUL byte.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 t... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchrnul.S | LGPL-2.1 | 581c785bf31bc74430320c7856bbfa3875d025fe | github | libc | https://github.com/bminor/glibc/blob/581c785bf31bc74430320c7856bbfa3875d025fe/sysdeps/i386/strchrnul.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchrnul.S:1 | /* strchrnul (str, chr) -- Return pointer to first occurrence of CHR in STR
or the final NUL byte.
For Intel 80x86, x>=3.
Copyright (C) 1994-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 t... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchrnul.S | LGPL-2.1 | 30891f35fa7da832b66d80d0807610df361851f3 | github | libc | https://github.com/bminor/glibc/blob/30891f35fa7da832b66d80d0807610df361851f3/sysdeps/i386/strchrnul.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchrnul.S:1 | /* strchrnul (str, chr) -- Return pointer to first occurrence of CHR in STR
or the final NUL byte.
For Intel 80x86, x>=3.
Copyright (C) 1994-2021 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.org>
Some optimisations by Alan Modra <Ala... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchrnul.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/strchrnul.S | 1 | 60 |
bminor/glibc:sysdeps/i386/strchrnul.S:2 | /* At the moment %edx contains CHR. What we need for the
algorithm is CHR in all bytes of the dword. Avoid
operations on 16 bit words because these require an
prefix byte (and one more cycle). */
movb %dl, %dh /* now it is 0|0|c|c */
movl %edx, %ecx
shll $16, %edx /* now it is c|c|0|0 */
movw %cx, ... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchrnul.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/strchrnul.S | 41 | 100 |
bminor/glibc:sysdeps/i386/strchrnul.S:3 | movb (%eax), %cl /* load byte in question (we need it twice) */
cmpb %cl, %dl /* compare byte */
je L(6) /* target found => return */
testb %cl, %cl /* is NUL? */
jz L(6) /* yes => return NULL */
incl %eax /* increment pointer */
/* No we have reached alignment. */
jmp L(11) /* begin loop */
/* ... | x86 | gas-att | handwritten | bminor/glibc | sysdeps/i386/strchrnul.S | LGPL-2.1 | 2b778ceb4010c28d70de9b8eab20e8d88eed586b | github | libc | https://github.com/bminor/glibc/blob/2b778ceb4010c28d70de9b8eab20e8d88eed586b/sysdeps/i386/strchrnul.S | 81 | 140 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.