This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [GCC] x86 optimizer suggestion
- From: Richard Henderson <rth at redhat dot com>
- To: Tom St Denis <tomstdenis at iahu dot ca>
- Cc: gcc at gnu dot org
- Date: Mon, 16 Jun 2003 19:49:36 -0700
- Subject: Re: [GCC] x86 optimizer suggestion
- References: <3EEE7E76.1050909@iahu.ca>
On Mon, Jun 16, 2003 at 10:35:34PM -0400, Tom St Denis wrote:
> unsigned long long t, w;
> unsigned long b;
>
> t = w / b;
> w = w % b;
...
> If I am not mistaken the x86 series [from 80386 and up] has a 64x32
> division instruction DIV which will divide EDX:EAX by another regmem
> value.
Yes, but it produces a 32-bit result, not a 64-bit result as
indicated here. Which means you'd get the wrong result for
0x4_0000_0000 / 2
r~