This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Make __mpexp_twomm1 an array of doubles


On Thursday, January 10, 2013 10:22:48 Siddhesh Poyarekar wrote:
> On Wed, Jan 09, 2013 at 08:17:29PM +0100, Andreas Jaeger wrote:
> > Please add a comment describing  __mpexp_twomm1. There was a comment
> > that you deleted - but I think this could be a bit more verbose.
> 
> I guess I could just move __mpexp_twomm1 into mpexp.c since there's no
> real need to have it as an shared constant - it is only used in
> mpexp.c.  That way I can describe what it is much more clearly, like
> in the patch below.  I formatted m1p like I did so that its
> association with __mpexp_twomm1 is easier to read.  In future there's
> a good opportunity to remote __mpexp_twomm1 completely once I have the
> patchset to convert mantissa to int (and supporting benchmark
> results) ready.
> 
> I'm not removing mpexp.h completely yet since I want to do a round of
> consolidation of all of the common constants to get them under a
> single header.  How does this look now?
> 
> Siddhesh
> 
> 	* sysdeps/ieee754/dbl-64/mpexp.c (__mpexp): New array of
> 	doubles __mpexp_twomm1.  Adjust usage.
> 	* sysdeps/ieee754/dbl-64/mpexp.h (__mpexp_twomm1): Remove.
> 
> diff --git a/sysdeps/ieee754/dbl-64/mpexp.c
> b/sysdeps/ieee754/dbl-64/mpexp.c index c404820..6937097 100644
> --- a/sysdeps/ieee754/dbl-64/mpexp.c
> +++ b/sysdeps/ieee754/dbl-64/mpexp.c
> @@ -47,8 +47,31 @@ __mpexp(mp_no *x, mp_no *y, int p) {
>    double a,b;
>    static const int np[33] = {0,0,0,0,3,3,4,4,5,4,4,5,5,5,6,6,6,6,6,6,
> 6,6,6,6,7,7,7,7,8,8,8,8,8};
> -  static const int m1p[33]=
> {0,0,0,0,17,23,23,28,27,38,42,39,43,47,43,47,50,54, -			      
> 57,60,64,67,71,74,68,71,74,77,70,73,76,78,81};
> +  static const int m1p[33]=
> +    {
> +      0, 0, 0, 0,
> +      17, 23, 23, 28,
> +      27, 38, 42, 39,
> +      43, 47, 43, 47,
> +      50, 54, 57, 60,
> +      64, 67, 71, 74,
> +      68, 71, 74, 77,
> +      70, 73, 76, 78,
> +      81
> +    };
> +  /* Stored values for 2^-m, where values of m are defined in M1P
> above.   */ +  static const double __mpexp_twomm1[] =

Let's add the 33 here as in all other cases as well.


This is ok,

Thanks,
Andreas
-- 
 Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]