Re: [PATCH] common implementation of iterative div/mod
- From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 13 May 2008 23:46:27 -0700
On Thu, 08 May 2008 16:16:41 +0100 Jeremy Fitzhardinge <jeremy@xxxxxxxx> wrote:
We have a few instances of the open-coded iterative div/mod loop, used
when we don't expcet the dividend to be much bigger than the divisor.
Unfortunately modern gcc's have the tendency to strength "reduce" this
into a full mod operation, which isn't necessarily any faster, and
even if it were, doesn't exist if gcc implements it in libgcc.
The workaround is to put a dummy asm statement in the loop to prevent
gcc from performing the transformation.
This patch creates a single implementation of this loop, and uses it
to replace the open-coded versions I know about.
Believe it or not, this patch causes one of my test machines to fail to
find its disk.
good dmesg: http://userweb.kernel.org/~akpm/dmesg-t61p.txt
bad dmesg: http://userweb.kernel.org/~akpm/dmesg-t61p-dead.txt
config: http://userweb.kernel.org/~akpm/config-t61p.txt
--
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/
- Follow-Ups:
- Re: [PATCH] common implementation of iterative div/mod
- From: Jeremy Fitzhardinge
- Re: [PATCH] common implementation of iterative div/mod
- References:
- Re: undefined reference to __udivdi3 (gcc-4.3)
- From: Robert Han***
- Re: undefined reference to __udivdi3 (gcc-4.3)
- From: Segher Boessenkool
- Re: undefined reference to __udivdi3 (gcc-4.3)
- From: Jeremy Fitzhardinge
- [PATCH] common implementation of iterative div/mod
- From: Jeremy Fitzhardinge
- Re: undefined reference to __udivdi3 (gcc-4.3)
- Prev by Date: Re: [PATCH 0/2]: Add sparc64 ftrace support.
- Next by Date: Re: POHMELFS high performance network filesystem. Transactions, failover, performance.
- Previous by thread: Re: [PATCH] common implementation of iterative div/mod
- Next by thread: Re: [PATCH] common implementation of iterative div/mod
- Index(es):