[Mono-list] Integer division problems

Dietmar Maurer dietmar@ximian.com
Sat, 09 Mar 2002 17:30:37 +0100


Martin Baulig wrote:

> Hi Dietmar,
>
> here's a patch which fixes the problem:
>
> ====
> 2002-03-09  Martin Baulig  <martin@gnome.org>
>
>         * x86.brg (DIV, DIV_UN): Clear EDX before performing the division.
>
> ====
>
>   ------------------------------------------------------------------------
>
>    diffName: diff
>        Type: unspecified type (application/octet-stream)
>
>   ------------------------------------------------------------------------
>
> Ok to commit ?

No, there is something wrong! I use CDQ to sign extend to 64bit in EAX/EDX,
so I assume your code is right for DIV_UN (althought you should remove that
unnecessary CDQ then), but DIV should work the way it is?

- Dietmar