Floating Point Bug in Bob's Emulator - second one found

Bob Supnik Bob.Supnik at digital.com
Fri Apr 10 23:19:59 AEST 1998


	A second bug has been found in the floating point emulator.  The
first (in MODf) caused FACTOR to malfunction.  This one causes problems
in AWK.

	The bug is in LDEXP.  In pdp11_fp.c:

	case 015:						/* LDEXP
*/
		dst = (dstspec <= 07)? R[dstspec]: ReadW (GeteaW
(dstspec));
		F_LOAD (qdouble, FR[ac], fac);
		fac.h = (fac.h & ~FP_EXP) | (((dst + FP_BIAS) &
FP_M_EXP) << FP_V_EXP);
		newV = 0;
	==>	if ((dst > 0177) || (dst <= 0177600)) {

	Change the indicated line to:

		if ((dst > 0177) && (dst <= 0177600)) {

	The test case is:

	# awk 'END {print 1+2}' < /dev/null

	incorrectly produced 0, now produces 3.

	/Bob Supnik

Received: (from major at localhost)
	by minnie.cs.adfa.oz.au (8.8.5/8.8.5) id XAA16423
	for pups-liszt; Fri, 10 Apr 1998 23:50:38 +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