From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 29 07:38:58 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1DE0337B439 for ; Tue, 29 Apr 2003 07:38:58 -0700 (PDT) Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD57243F3F for ; Tue, 29 Apr 2003 07:38:56 -0700 (PDT) (envelope-from brandt@fokus.fraunhofer.de) Received: from beagle (beagle [193.175.132.100])h3TEcqE19690; Tue, 29 Apr 2003 16:38:52 +0200 (MEST) Date: Tue, 29 Apr 2003 16:38:52 +0200 (CEST) From: Harti Brandt To: David Gilbert In-Reply-To: <16046.36204.494761.258593@canoe.velocet.net> Message-ID: <20030429163802.D38451@beagle.fokus.fraunhofer.de> References: <20030427065621.G40030-100000@haldjas.folklore.ee> <16046.36204.494761.258593@canoe.velocet.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org cc: Oliver Fromme Subject: Re: [hackers] Re: x86-64 support X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2003 14:38:58 -0000 On Tue, 29 Apr 2003, David Gilbert wrote: DG>>>>>> "Oliver" == Oliver Fromme writes: DG> DG>Oliver> Narvi wrote: DG>>> On Sat, 26 Apr 2003, M. Warner Losh wrote: > In message: DG>>> <20030427064014.H40030-100000@haldjas.folklore.ee> > Narvi DG>>> writes: > : option USE_PI_DIGITS 100 DG>>> > DG>>> > Only if you could implement it with integer math :-) DG>>> DG>>> where's the problem in that ? most mp libs use integer arithmetic, DG>>> and x86-64 gives you 64x64->128 bit widening multiplies 8-) DG> DG>Oliver> You don't need that; the digits of pi can be calculated quite DG>Oliver> easily with integer math. This snippet is from my signature DG>Oliver> collection: DG> DG>Oliver> int f[9800],b,c=9814,g,i;long DG>Oliver> a=1e4,d,e,h;main(){for(;b=c,c-=14;i=printf( DG>Oliver> "%04d",e+d/a),e=d%a)while(g=--b*2)d=h*b+a*(i?f[b]:a/5),h=d/--g,f[b]=d%g;} DG> DG>With gcc -o pi pi.c, the output is: DG> DG>[2:19:319]dgilbert@canoe:~/devel> ./pi DG>187700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 DG> DG>and so on. All Zeros. DG> DG>With gcc -O -o pi pi.c, the output is: DG> DG>[2:21:321]dgilbert@canoe:~/devel> ./pi DG>501859265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316 DG> DG>... and so on for many digits. Neither matches: DG> DG>echo "scale=200; 4*a(1)" | bc -l DG>3.141592653589793238462643383279502884197169399375105820974944592307\ DG>81640628620899862803482534211706798214808651328230664709384460955058\ DG>223172535940812848111745028410270193852110555964462294895493038196 If you look careful only the first four digits don't match. harti -- harti brandt, http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.fraunhofer.de, harti@freebsd.org