Bug in Bob Supnik's Emulator?

Bob Supnik Bob.Supnik at digital.com
Tue Apr 7 07:25:57 AEST 1998


There is indeed a bug in the floating point emulator: MODf was setting
the condition codes off the integer result, not the fractional result.

To fix the bug, look for this code fragment in source module pdp11_fp.c

case 3:							/* MODf */
	ReadFP (&fsrc, GeteaFP (dstspec, lenf), dstspec, lenf);
	F_LOAD (qdouble, FR[ac], fac);
	newV = modfp11 (&fac, &fsrc, &modfrac);
	F_STORE (qdouble, fac, FR[ac | 1]);
	F_STORE (qdouble, modfrac, FR[ac]);
==>	FPS = setfcc (FPS, fac.h, newV);
	break;

Change the indicated code line to be:

==>	FPS = setfcc (FPS, modfrac.h, newV);

and recompile.

Thanks to Warren Toomey for getting me the source to FACTOR, which
showed the bug.

(I can't believe this is the problem with vi, but who knows?  A bug in
MODf could affect the binary to decimal conversion routines in the run
time libraries.)

Received: (from major at localhost)
	by minnie.cs.adfa.oz.au (8.8.5/8.8.5) id IAA00880
	for pups-liszt; Tue, 7 Apr 1998 08:04:43 +1000 (EST)
X-Authentication-Warning: minnie.cs.adfa.oz.au: major set sender to owner-pups at minnie.cs.adfa.oz.au using -f


More information about the TUHS mailing list