[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with the MiNT library, -m68020
- To: mint@terminator.rs.itd.umich.edu
- Subject: Re: Problem with the MiNT library, -m68020
- From: Juergen Lock <nox@jelal.hb.north.de>
- Date: Sat, 18 Mar 95 17:58:00 CET
- In-reply-to: <199408131137.HAA11022@terminator.rs.itd.umich.edu>; from "Nicholas S Castellano" at Aug 14, 94 12:26 am
greetings...
Michael reminded us of this somewhat older message from entropy,
can someone with a >= 68020 + 68881 and who knows our floatlib a bit
better than me :) (Andreas?) look into this? i.e. is this all that
needs be fixed, etc...
thanx + cheers
Juergen
Nicholas S Castellano writes:
> I recently was working with a program that uses floating point math.
> I discovered that it worked correctly if compiled without -m68020, but
> if compiled with -m68020 -lgnu020, I got some really strange behavior:
>
> int
> main()
> {
> double d;
> int i = 200;
> d = (double) i;
> printf("%f\n", d);
> }
>
> ...yields output of 0.0.
>
> The problem seems to be in the 68881 version of the __floatsidf
> routine. The following patch seems to cure my problem. However, the
> solution provided here is based on GUESSWORK: I do not have a manual
> for the 68881 and I do not really know what order GCC expects to find
> the return values in d0,d1. My guess was based only on the fact that
> the SFP version of the code loads d0 first and then d1, whereas the
> 68881 version uses a moveml to d0-d1 (which loads d1 first and then
> d0). This may be irrelevant, but it's all I had to work with. Could
> someone with more docs and more of a clue look into this? I think the
> problem may affect several other conversion routines as well.
>
> Cheers,
> entropy
>
> --- 45.1 1994/07/17 10:49:40
> +++ _fltsi.cpp 1994/08/12 17:04:14
> @@ -15,7 +15,8 @@
> |
> fintrzd a7@(4),fp0 | load long int to fp0
> fmoved fp0,a7@- | get double from fp0
> - moveml a7@+,d0-d1
> + movel a7@+,d0
> + movel a7@+,d1
> rts
>
> #endif __M68881__
>
>
>
> --
> entropy -- it's not just a good idea, it's the second law.
> Personal mail: entropy@gnu.ai.mit.edu
> MiNT library mail: entropy@terminator.rs.itd.umich.edu
> "what do you have against octal?" -jrb
--
J"urgen Lock / nox@jelal.hb.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
...ohne Gewehr
PGP public key fingerprint = 8A 18 58 54 03 7B FC 12 1F 8B 63 C7 19 27 CF DA