[lkml]   [2003]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [TRIVIAL] kstrdup
Followup to:  <>
By author: Jeff Garzik <>
In newsgroup:
> That's kinda cute. Why not submit a patch to the strcpy implementation
> in include/asm-i386/string.h? :) Ours is shorter, but does have a jump:
> "1:\tlodsb\n\t"
> "stosb\n\t"
> "testb %%al,%%al\n\t"
> "jne 1b"
> Which is better? I don't know; I'm still learning the performance
> eccentricities of x86 insns on various processors.

It varies from porocessor to processor, and also depends on usage.

> Related x86 question: if the memory buffer is not dword-aligned, is
> 'rep movsl' the best idea? On RISC it's usually smarter to unroll the
> head of the loop to avoid unaligned accesses; but from reading x86 asm
> code in the kernel, nobody seems to care about that. Is the
> unaligned-access penalty so small that the increased code size of the
> head-unroll is never worth it?

A lot of the newer x86 processors will perform this unrolling in

<> at work, <> in private!
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:34    [W:0.057 / U:5.688 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site