Re: x86: faster strncpy_from_user()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2012-04-10 at 17:57 -0700, Linus Torvalds wrote:
> On Tue, Apr 10, 2012 at 5:50 PM, Linus Torvalds
> <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > .. and you don't have a double shift, right? So you'd need to do two
> > shifts and the or for each word.
> 
> Actually, if sparc has a "rotate" instruction, you can do with a
> single shift (rotate) per word loop.
> 
> You need to set up a mask register based on the alignment, and
> pre-load the first word, but if you do have a rotate you can rotate
> and then use "and mask" first to generate the "high bits" of the
> current word, and then use the "andn mask" to generate the low bits of
> the next word. So then you just need a single rotate per loop, and
> some (very minor) loop prep.
> 
> Of course, RISC people tended to throw out rotate too, so maybe you
> don't have even that.

Well, we do have a very nice & flexible rotate & mask on ppc at
least :-)

Cheers,
Ben.


--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux