Re: MSEC_TO_JIFFIES is messed up...

From: Davide Libenzi
Date: Wed May 12 2004 - 16:53:44 EST


On Wed, 12 May 2004, Ingo Molnar wrote:

>
> * Davide Libenzi <davidel@xxxxxxxxxxxxxxx> wrote:
>
> > int foo(int i) {
> >
> >
> > return i * 1000 / 1000;
> > }
>
> try unsigned and you'll see:
>
> pushl %ebp
> movl %esp, %ebp
> movl 8(%ebp), %edx
> movl %edx, %eax
> sall $2, %eax
> addl %edx, %eax
> leal 0(,%eax,4), %edx
> addl %edx, %eax
> leal 0(,%eax,4), %edx
> addl %edx, %eax
> leal 0(,%eax,8), %edx
> movl $274877907, %eax
> mull %edx
> movl %edx, %eax
> shrl $6, %eax
> leave
> ret

Yeah, I see.



- Davide

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