[PATCH]: Sparc SUN4V Niagara optimized memset/memcpy
David S. Miller
davem@davemloft.net
Wed Mar 1 21:19:00 GMT 2006
From: Ulrich Drepper <drepper@redhat.com>
Date: Wed, 01 Mar 2006 07:50:15 -0800
> David S. Miller wrote:
>
> > +ENTRY(memset)
> > + /* %o0=buf, %o1=pat, %o2=len */
> > + and %o1, 0xff, %o3
> > + mov %o2, %o1
> > + sllx %o3, 8, %g1
> > + or %g1, %o3, %o2
> > + sllx %o2, 16, %g1
> > + or %g1, %o2, %o2
> > + sllx %o2, 32, %g1
> > + ba,pt %XCC, 1f
> > + or %g1, %o2, %o2
> > +
> > +ENTRY(__bzero)
>
> This is confusing data. No two functions should overlap. I suggest to
> make bzero a little function calling memset similar to what you did with
> bcopy.
That's a waste of cycles and I-cache usage, for what gain?
I don't see why a function cannot have an alternate entry like this.
More information about the Libc-hacker
mailing list