Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Oct 1996 20:17:53 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        jin@george.lbl.gov, jkh@time.cdrom.com
Cc:        bugs@FreeBSD.org
Subject:   Re: compiler bug in 2.2-961006-SNAP release
Message-ID:  <199610111017.UAA21685@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> Actually, it looks more to me like memset() simply needs to move into
>> libkern.
>
>If the bzero and memset can be merged (bzero can be macro of memset), this

That would waste cpu power for the extra arg to memset and extra processing
to detect when the arg is 0 and join the bcopy code.

>should be a good idea. To maintain two assemble code for bzero and memset
>costs both human and CPU power. 

We already have memcpy, bcopy, ovbcopy, generic_bcopy, i586_bcopy, copyin,
copyout, fastmove, bzero, generic_bzero, i486_bzero and i586_bzero.  One
more wouldn't be noticed :-).  These routines do the following:

memcpy: a simple version based on "rep movs".  Only handles non-overlapped
	copies.  Probably only used when the kernel is compiled with -O0
	or with a non-gcc compiler, since gcc inlines memcpy().  Should
	not be used for large copies because "rep movs" may be slow.
	Should be used for small copies to give gcc a chance to inline it.
bcopy: entry point for generic_bcopy and i586_bcopy.
ovbcopy: same as bcopy, for old code that doesn't assume that bcopy
	handles overlapping copies.
generic_bcopy: same as memcpy except of course its args are in a different
	it handles overlapping copies, and it handles overlapping copies.
i586_bcopy: i586-optimized version of generic_bcopy.
copyin, copyout: special versions of bcopy for copying to and from user
	space.  Traps must be handled.
fastmove: i586-optimized part of copyin and copyout.
bzero: function pointer pointing to generic_bzero, i486_bzero or i586_bzero.
generic_bzero: a simple version based on "rep stos".
i486_bzero: i486-optimized version of generic_bzero.
i586_bzero: i586-optimized version of generic_bzero.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610111017.UAA21685>