Subject: The FPU emulation prob.
To: None <port-mac68k@netbsd.org>
From: =?ISO-2022-JP?B?GyRCRiNKLCEhNXwbKEI=?= <IZY01245@nifty.ne.jp>
List: port-mac68k
Date: 03/17/1999 09:12:39
Re: The FPU emulation problem
I succeeded to boot NetBSD on my Mac. Thank you very much. Since I have g
ot comp.tgz in addition to base, kern and etc.tgz, I tried to make a program.
Although I did my best to execute the program of which the source is shown be
low, it always makes wrong answers. This makes four answers of the same multi
plication in different types, and two of them are wrong: float and double ones
become 1076756480, not 15.000000.
After running another program, I reached a supposition that FPU emulator do
es not work properly (I am using LC475). It seems to be ready whenever I boot
my machine, for I can find an message that says "fpu0 at mainbus0 (emulator)"
before the login prompt appears. In reality it does not seem to work at all
when real number calculation is needed.
I want to know how to have the emulator work correctly. Do I need anything
more to improve my system ? (I do not think so, in fact.) Please respond to
me.
(This is the program I ran.)
#include <stdio.h>
main()
{
int ia, imult(int, int);
float fa, fmult(float, float);
double da, dmult(double, double);
long la, lmult(long, long);
ia = imult(3, 5);
printf("int %d\n", ia);
fa = fmult(3.0, 5.0);
printf("float %d\n", fa);
da = dmult(3.0, 5.0);
printf("double %d\n", da);
la = lmult(3l, 5l);
printf("long %ld\n", la);
}
int
imult(int x, int y)
{
return (x * y);
}
float
fmult(float x, float y)
{
return (x * y);
}
double
dmult(double x, double y)
{
return (x * y);
}
long
lmult(long x, long y)
{
return (x * y);
}
(This is the result of the above program on my Mac.)
int 15
float 1076756480
double 1076756480
long 15
Regards,