*BSD News Article 5313


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel!munnari.oz.au!uunet!sun-barr!sh.wide!wnoc-kyo!kuis!kmc-box2!nntp!ishii
From: ishii@kmc.kyoto-u.ac.jp (Ishii Masahiro)
Subject: Re: [386BSD] math_emulate.c (w/patch) and probably fixed atof(3) w/o FPU
In-Reply-To: ishii@box2.kmc.kyoto-u.ac.jp's message of Sat, 19 Sep 1992 11:28:08 GMT
Message-ID: <ISHII.92Sep20182400@kotetsu.kmc.kyoto-u.ac.jp>
Sender: news@box2.kmc.kyoto-u.ac.jp (News system Manager #2)
Nntp-Posting-Host: kotetsu
Organization: Kyoto University Microcomputer Club, Kyoto, Japan
References: <1992Sep19.112808.27835@box2.kmc.kyoto-u.ac.jp>
Date: Sun, 20 Sep 1992 09:24:00 GMT
Keyword: math emulation, atof
Lines: 49

Hello,

	I posted previously the patch, but I received email from
kym@bingsuns.cc.binghamton.edu who said that he had posted the patch 4
weeks ago and my patch is not sufficient.

	I confirmed that, and I post the patch again. Patch to Fscale()
is owing to kym@bingsuns.cc.binghamton.edu. Thank you.

	After applying this patch, make sure to recompile your kernel
TWICE. Precise arrangement is in the article <1992Sep19.112808.27835@box2.kmc.kyoto-u.ac.jp>.

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

*** math_emulate.c.orig	Sat Sep 19 01:30:57 1992
--- math_emulate.c	Sun Sep 20 17:17:42 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));
***************
*** 1387,1392 ****
--- 1387,1396 ----
  	temp_int ti;
  
  	*c = *a;
+ 	if(!c->a && !c->b) {
+ 		c->exponent = 0;
+ 		return;
+ 	}
  	real_to_int(b, &ti);
  	if(ti.sign)
  		c->exponent -= ti.a;