minix/lib/libc/arch/i386/string
Arun Thomas 9a21d1a2fd Macros for symbols used in both ASM and C
-The macros take care of prepending the leading underscore when
 necessary.
2010-08-17 16:44:07 +00:00
..
_memmove.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
_strncat.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
_strncmp.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
_strncpy.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
_strnlen.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
bcmp.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
bcopy.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
bzero.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
index.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
Makefile.inc Convert library asm files to GAS syntax 2010-03-03 14:27:30 +00:00
memchr.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
memcmp.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
memcpy.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
memmove.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
memset.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
README Incorporate bsdmake into buildsystem and reorganize libs 2010-02-16 14:41:33 +00:00
rindex.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
strcat.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
strchr.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
strcmp.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
strcpy.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
strlen.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
strncat.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
strncmp.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
strncpy.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
strnlen.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00
strrchr.S Macros for symbols used in both ASM and C 2010-08-17 16:44:07 +00:00

Notes on i80386 string assembly routines.		Author: Kees J. Bot
								2 Jan 1994

Remarks.
    All routines set up proper stack frames, so that stack traces can be
    derived from core dumps.  String routines are often the ones that
    get the bad pointer.

    Flags are often not right in boundary cases (zero string length) on
    repeated string scanning or comparing instructions.  This has been
    handled in sometimes nonobvious ways.

    Only the eax, edx, and ecx registers are not preserved, all other
    registers are.  This is what GCC expects.  (ACK sees ebx as scratch
    too.)  The direction byte is assumed to be wrong, and left clear on
    exit.

Assumptions.
    The average string is short, so short strings should not suffer from
    smart tricks to copy, compare, or search large strings fast.  This
    means that the routines are fast on average, but not optimal for
    long strings.

    It doesn't pay to use word or longword operations on strings, the
    setup time hurts the average case.

    Memory blocks are probably large and on word or longword boundaries.

    No unaligned word moves are done.  Again the setup time may hurt the
    average case.  Furthermore, the author likes to enable the alignment
    check on a 486.

String routines.
    They have been implemented using byte string instructions.  The
    length of a string it usually determined first, followed by the
    actual operation.

Strcmp.
    This is the only string routine that uses a loop, and not
    instructions with a repeat prefix.  Problem is that we don't know
    how long the string is.  Scanning for the end costs if the strings
    are unequal in the first few bytes.

Strchr.
    The character we look for is often not there, or at some distance
    from the start.  The string is scanned twice, for the terminating
    zero and the character searched, in chunks of increasing length.

Memory routines.
    Memmove, memcpy, and memset use word or longword instructions if the
    address(es) are at word or longword boundaries.  No tricks to get
    alignment after doing a few bytes.  No unaligned operations.