This code uses subb instead of cmpb to compare chars. When they are
not equal, the function's return value is computed by sign extending
the difference. The basic idea was contributed by Hiroshi Horitomo
<horimoto@cs-aoi.cs.sist.ac.jp> in PR #3223, but his implementation
used additional instructions to compute the return value.
Also, the series of insns used to compare one pair of characters has
been unrolled 4 times. This helps the 680[23]0, where the cost of a
taken branch is significantly more than that of a not-taken branch.
The implementation of these functions is losely based on the original
BSD code plus versions I was working on which would yeild code tuned
for a particular m68k or coldfire family cpu, code space or run time
efficiency, etc. depending on the values of various macros.
My original code was intended for use in OS-less embedded systems.
Because NetBSD can not benefit from the considerable complexity, I've
removed the extraneous preprocessor goop. The resulting code is tuned
for the '020 - '060. It will not function on the '000 or coldfire.
* Remove $Id$ headers.
* Support LIB_SCCS in all files.
* Use local labels where ever possible.
* Use cpufunc.h instead of __asm__ when possible.
* Access labels with _C_LABEL and _ASM_LABEL.
* Always set errno by calling cerror.
* No more FRAME/EMARF.
* No more SVC, use SYSTRAP instead.
* Use "$Masqueraded: as XXX $" to show e.g. memcpy compiled as bcopy.
* Rewrite vfork to work even whith a "real" vfork system call.
* Make cerror take care of _REENTRANT.
faster) byte-displacement form of the instruction if the offset will
fit. This happens to be all occurances in this case, so I could have
used bCCs. However, a quick survey of the rest of NetBSD's m68k code
showed that jCC was used in similar cases. I did the same to be
consistant.
memory regions are "potentially overlapping" to a test that determines
that the regions are actually overlapping. Because the code for the
overlapping case is seven instructions longer, this signifcantly
improves performance in the average case.
for the address of a variable used to store the error number instead
of writing to the global errno.
In a multi-threaded program, __errno() will return a pointer to a
thread-specific variable.
SYSCALL_NOERROR(x): Like SYSCALL except that "x" is a syscall
that can never fail.
RSYSCALL_NOERROR(x): Like RSYSCALL except that "x" is a syscall
that can never fail.
These macros simply call SYSCALL / RSYSCALL, and serve as placeholders
until an optimized implementation is done.
Changed all instances of ENTRY() to match the new calling convention
(it takes a second argument ).
Added new macros:
SYSTRAP(x): Expands to the code used to call syscall x.
This is used to simplify other macros.
SYSCALL_NOERROR(x): Like SYSCALL except that "x" is a syscall
that can never fail.
RSYSCALL_NOERROR(x): Like RSYSCALL except that "x" is a syscall
that can never fail.
SYSTRAP(x): Expands to the code used to call syscall x.
This is used to simplify other macros.
SYSCALL_NOERROR(x): Like SYSCALL except that "x" is a syscall
that can never fail.
RSYSCALL_NOERROR(x): Like RSYSCALL except that "x" is a syscall
that can never fail.
SYSTRAP(x): Expands to the code used to call syscall x.
This is used to simplify other macros.
SYSCALL_NOERROR(x): Like SYSCALL except that "x" is a syscall
that can never fail.
RSYSCALL_NOERROR(x): Like RSYSCALL except that "x" is a syscall
that can never fail.