*BSD News Article 5279


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel!munnari.oz.au!spool.mu.edu!wupost!cs.utexas.edu!sun-barr!sh.wide!wnoc-kyo!kuis!kmc-box2!ishii
From: ishii@box2.kmc.kyoto-u.ac.jp (Ishii Masahiro)
Subject: [386BSD] math_emulate.c (w/patch) and probably fixed atof(3) w/o FPU
Message-ID: <1992Sep19.112808.27835@box2.kmc.kyoto-u.ac.jp>
Reply-To: ishii@kuee.kyoto-u.ac.jp,ishii@kmc.kyoto-u.ac.jp
Organization: Kyoto University Microcomputer Club, Kyoto, JAPAN
Date: Sat, 19 Sep 1992 11:28:08 GMT
Keyword: math emulation, atof
Lines: 44

Hello,

	If your machine has FPU (or 486DX), you may ignore this patch.

	We found out a BUG in /usr/src/sys.386bsd/i386/i386/math_emulate.c.
It is serious, if your machine has no FPU. We expect that this patch
will fix also 'atof(3)' BUG on NO-FPU machine.

	Without this patch or FPU, sources including floating point
constant (for example, /sys/vm/vm_meter.c) are not correctly compiled.
And so, after applying this patch, make sure to re-compile the kernel
as follows,

	1) Apply this patch to /sys/i386/i386/math_emulate.c.
	2) Make kernel.
	3) Replace the old kernel with this one, and reboot.
	4) Make clean on /sys/compile/YOURCONFIG and make your kernel again.
	5) Again, replace the kernel with last-compiled.

	Follows are the patch.

*** math_emulate.c.orig	Sat Sep 19 01:30:57 1992
--- math_emulate.c	Sat Sep 19 01:31:33 1992
***************
*** 163,169 ****
  			/* incomplete and totally inadequate -wfj */
  			Fscale(PST(0), PST(1), &tmp);
  			real_to_real(&tmp,&ST(0));
! 			/* fall into .. */
  		case 0x1fc:
  			frndint(PST(0),&tmp);
  			real_to_real(&tmp,&ST(0));
--- 163,169 ----
  			/* incomplete and totally inadequate -wfj */
  			Fscale(PST(0), PST(1), &tmp);
  			real_to_real(&tmp,&ST(0));
! 			return(0);
  		case 0x1fc:
  			frndint(PST(0),&tmp);
  			real_to_real(&tmp,&ST(0));

--
Kyoto University Microcomputer Club (Japan)     M.Ishii@KMC
						ishii@kmc.kyoto-u.ac.jp