From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 29 07:34:34 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 81A9037B409 for ; Tue, 29 Apr 2003 07:34:34 -0700 (PDT) Received: from sabre.velocet.net (sabre.velocet.net [216.138.209.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9453043FBF for ; Tue, 29 Apr 2003 07:34:33 -0700 (PDT) (envelope-from dgilbert@velocet.ca) Received: from trooper.velocet.ca (trooper.velocet.net [216.138.242.2]) by sabre.velocet.net (Postfix) with ESMTP id CD71113826D; Tue, 29 Apr 2003 10:34:24 -0400 (EDT) Received: by trooper.velocet.ca (Postfix, from userid 66) id 4BC8274748; Tue, 29 Apr 2003 10:34:24 -0400 (EDT) Received: by canoe.velocet.net (Postfix, from userid 101) id 8924D567607; Tue, 29 Apr 2003 10:34:20 -0400 (EDT) From: David Gilbert MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16046.36204.494761.258593@canoe.velocet.net> Date: Tue, 29 Apr 2003 10:34:20 -0400 To: Oliver Fromme In-Reply-To: <200304280054.h3S0sTi2006266@lurza.secnetix.de> References: <20030427065621.G40030-100000@haldjas.folklore.ee> <200304280054.h3S0sTi2006266@lurza.secnetix.de> X-Mailer: VM 7.07 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid cc: freebsd-hackers@FreeBSD.ORG Subject: [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:34:34 -0000 >>>>> "Oliver" == Oliver Fromme writes: Oliver> Narvi wrote: >> On Sat, 26 Apr 2003, M. Warner Losh wrote: > In message: >> <20030427064014.H40030-100000@haldjas.folklore.ee> > Narvi >> writes: > : option USE_PI_DIGITS 100 >> > >> > Only if you could implement it with integer math :-) >> >> where's the problem in that ? most mp libs use integer arithmetic, >> and x86-64 gives you 64x64->128 bit widening multiplies 8-) Oliver> You don't need that; the digits of pi can be calculated quite Oliver> easily with integer math. This snippet is from my signature Oliver> collection: Oliver> int f[9800],b,c=9814,g,i;long Oliver> a=1e4,d,e,h;main(){for(;b=c,c-=14;i=printf( 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;} With gcc -o pi pi.c, the output is: [2:19:319]dgilbert@canoe:~/devel> ./pi 187700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 and so on. All Zeros. With gcc -O -o pi pi.c, the output is: [2:21:321]dgilbert@canoe:~/devel> ./pi 501859265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316 ... and so on for many digits. Neither matches: echo "scale=200; 4*a(1)" | bc -l 3.141592653589793238462643383279502884197169399375105820974944592307\ 81640628620899862803482534211706798214808651328230664709384460955058\ 223172535940812848111745028410270193852110555964462294895493038196 Dave. -- ============================================================================ |David Gilbert, Velocet Communications. | Two things can only be | |Mail: dgilbert@velocet.net | equal if and only if they | |http://daveg.ca | are precisely opposite. | =========================================================GLO================