This is actually two patches in one. It fixes the Floating Point
Emulation in two places. The first is for the 0x1fd instruction; the
second is in Fscale. It is believed to fix the atof() function, among
others, which normally fails on non-FPU machines.
AUTHOR: Ishii Masahiro, R. Kym Horsell
386BSD-Patchkit: patch00046
* The other files also don't care about ST(x) etc - they just get addresses
* to 80-bit temporary reals, and do with them as they please. I wanted to
* hide most of the 387-specific things here.
* The other files also don't care about ST(x) etc - they just get addresses
* to 80-bit temporary reals, and do with them as they please. I wanted to
* hide most of the 387-specific things here.
+ *
+ * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
+ * -------------------- ----- ----------------------
+ * CURRENT PATCH LEVEL: 1 00046
+ * -------------------- ----- ----------------------
+ *
+ * 19 Sep 92 Ishii Masahiro Fix 0x1fd instruction
+ * kym@bingsuns.cc.binghamton.edu Fix fscale
*/
#include "machine/cpu.h"
*/
#include "machine/cpu.h"
/* incomplete and totally inadequate -wfj */
Fscale(PST(0), PST(1), &tmp);
real_to_real(&tmp,&ST(0));
/* incomplete and totally inadequate -wfj */
Fscale(PST(0), PST(1), &tmp);
real_to_real(&tmp,&ST(0));
+ return(0); /* 19 Sep 92*/
case 0x1fc:
frndint(PST(0),&tmp);
real_to_real(&tmp,&ST(0));
case 0x1fc:
frndint(PST(0),&tmp);
real_to_real(&tmp,&ST(0));
+ if(!c->a && !c->b) { /* 19 Sep 92*/
+ c->exponent = 0;
+ return;
+ }
real_to_int(b, &ti);
if(ti.sign)
c->exponent -= ti.a;
real_to_int(b, &ti);
if(ti.sign)
c->exponent -= ti.a;