On Saturday 02 April 2005 15:18, Denis Vlasenko wrote:
> -O2 compile does inline copying, however, suboptimally.
> Pushing/popping esi/edi on the stack is not needed.
> Also "mov $1,ecx; rep; movsl" is rather silly.
I think I am wrong about push/pop. Sorry.
However, other observation is still val
> > childregs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long)
> > p->thread_info)) - 1;
> > *childregs = *regs;
> > ^^^
> > childregs->eax = 0;
> > childregs->esp = esp;
> >
> > # make arch/i386/kernel/process.s
> >
> > copy_thread:
>
> On Wednesday 30 March 2005 05:27, Gerold Jury wrote:
> >
> > >> On Tue, Mar 29, 2005 at 05:37:06PM +0300, Denis Vlasenko wrote:
> > >> > /*
> > >> > * This looks horribly ugly, but the compiler can optimize it totally,
> > >> > * as the count is constant.
> > >> > */
> > >> > static inline vo
On Wednesday 30 March 2005 05:27, Gerold Jury wrote:
>
> >> On Tue, Mar 29, 2005 at 05:37:06PM +0300, Denis Vlasenko wrote:
> >> > /*
> >> > * This looks horribly ugly, but the compiler can optimize it totally,
> >> > * as the count is constant.
> >> > */
> >> > static inline void * __constant_
>
> On Tue, Mar 29, 2005 at 05:37:06PM +0300, Denis Vlasenko wrote:
> > /*
> > * This looks horribly ugly, but the compiler can optimize it totally,
> > * as the count is constant.
> > */
> > static inline void * __constant_memcpy(void * to, const void * from, size_t
> > n)
> > {
> > i
On Tue, Mar 29, 2005 at 05:37:06PM +0300, Denis Vlasenko wrote:
> typedef unsigned int size_t;
>
> static inline void * __memcpy(void * to, const void * from, size_t n)
> {
> int d0, d1, d2;
> __asm__ __volatile__(
> "rep ; movsl\n\t"
> "testb $2,%b4\n\t"
> "je 1f\n\t"
>
Denis Vlasenko wrote:
Disassembly of section .text:
e: e8 fc ff ff ff call f
f: R_386_PC32 memcpy
#define memcpy(t, f, n) \
(__builtin_constant_p(n) ? \
__constant_memcpy((t),(f),(n)) : \
__memcpy((t),(f),(n)))
given this #define, how can 'memcpy' appe
On Tue, 29 Mar 2005 17:37:06 +0300, Denis Vlasenko <[EMAIL PROTECTED]> wrote:
> Try testcase below the sig.
>
> This causes nearly one thousand calls to memcpy in my kernel
> (not an allyesconfig one):
> static inline void * __memcpy(void * to, const void * from, size_t n)
> {
> int d0, d1, d2;
>
Try testcase below the sig.
This causes nearly one thousand calls to memcpy in my kernel
(not an allyesconfig one):
# objdump -d vmlinux | grep -F '' | wc -l
959
# gcc -O2 -c t.c
# objdump -r -d t.o
t.o: file format elf32-i386
Disassembly of section .text:
:
0: 55