NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-m68k/51645 (exponential and hyperbolic functions are slow on m68k FPU emulator)



The following reply was made to PR port-m68k/51645; it has been noted by GNATS.

From: Tetsuya Isaki <isaki%pastel-flower.jp@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: isaki%NetBSD.org@localhost, port-m68k-maintainer%netbsd.org@localhost,
	netbsd-bugs%netbsd.org@localhost,
	gnats-admin%netbsd.org@localhost,
	rokuyama%rk.phys.keio.ac.jp@localhost
Subject: Re: port-m68k/51645 (exponential and hyperbolic functions are slow on m68k FPU emulator)
Date: Mon, 05 Dec 2016 21:49:10 +0900

 It's a nice patch!
 It's 10..100 times faster as you wrote.
 The accuracy decreased slightly in extended precision but
 I think it's not a big problem because faster is better.
 
 I'll add the following diffs to your patch and commit.
 
 --- fpu_exp.c	2016-12-02 15:50:41.000000000 +0900
 +++ fpu_exp.c	2016-12-02 15:52:14.000000000 +0900
 @@ -133,10 +133,11 @@
  		fp = fpu_etox_taylor(fe);
  		return fp;
  	}
 +	/* extract k as integer format from fpn format */
  	j = FP_LG - fp->fp_exp;
  	if (j < 0) {
  		if (fp->fp_sign)
 -			fpu_const(&fe->fe_f2, FPU_CONST_0);	/* k < -2^18 */
 +			fp->fp_class = FPC_ZERO;		/* k < -2^18 */
  		else
  			fp->fp_class = FPC_INF;			/* k >  2^18 */
  		return fp;
 --- fpu_hyperb.c	2016-11-28 13:55:22.000000000 +0900
 +++ fpu_hyperb.c	2016-12-02 15:54:43.000000000 +0900
 @@ -63,9 +63,6 @@
  
  #include "fpu_emulate.h"
  
 -/* The number of items to terminate the Taylor expansion */
 -#define MAX_ITEMS	(2000)
 -
  /*
   * fpu_hyperb.c: defines the following functions
   *
 
 ---
 Tetsuya Isaki <isaki%pastel-flower.jp@localhost / isaki%NetBSD.org@localhost>
 


Home | Main Index | Thread Index | Old Index