gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: Bug in mpn/m68k/lshift.asm


From: Kevin Ryde
Subject: [Gcl-devel] Re: Bug in mpn/m68k/lshift.asm
Date: Fri, 16 Aug 2002 08:15:39 +1000
User-agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.1 (i386-debian-linux-gnu)

Camm Maguire <address@hidden> writes:
>
> 0x8007a944 <__gmpn_lshift+52>:        movel %d6,%d0
> 0x8007a946 <__gmpn_lshift+54>:        asll #2,%d0
> 0x8007a948 <__gmpn_lshift+56>:        addal %d6,%a0
> 0x8007a94a <__gmpn_lshift+58>:        addal %d6,%a1
>
> i reg a0
> a0             0x80242bdd     0x80242bdd

Thanks, I think there's a bug there.  It adds plain "size" to the
pointers, not 4*size.  Patch for lshift.asm below, if you'd like to
give it a run.

The try.c program can be used to exercise low level routines like that
too,

        cd tests/devel
        make try
        ./try mpn_lshift

It'll run nearly forever, let it go for a minute or so then kill it.


> I short, the issue persists.  I've tried gcc-3.0, and
> configuring as mc68020  (the machine is an 060).  Same symptoms.

The bad bit is in the 68000 case.  If you're using the packaged
libgmp3 then that's configured as "m68k-linux" which will hit that
code.

> Configuring with --build=none... compiles, but loses precision
> apparently on some maxima numerical tests.

Don't know why that should be, the asm and C ought to come out
identical.

> Lastly, linking with gmp2
> works fine -- compiling and passing all tests.

The bug is in gmp 2 also, but doesn't get exposed since lshift.S lets
gcc tell it what the chip is, and 68020 is apparently the default for
that.


Attachment: lshift.asm.diff
Description: Source code patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]