From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: Re: GMP bignum results using double cells. Date: Sat, 01 Mar 2003 08:45:58 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <871y1s58ih.fsf@zip.com.au> References: <878yw3o8rd.fsf@raven.i.defaultvalue.org> <87vfz6wvw1.fsf@zip.com.au> <873cmaseb8.fsf@raven.i.defaultvalue.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1046472788 24863 80.91.224.249 (28 Feb 2003 22:53:08 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 28 Feb 2003 22:53:08 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18otNI-0006Sh-00 for ; Fri, 28 Feb 2003 23:53:04 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18otML-00012U-05 for guile-devel@m.gmane.org; Fri, 28 Feb 2003 17:52:05 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18otIx-0007VW-00 for guile-devel@gnu.org; Fri, 28 Feb 2003 17:48:35 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18otHp-0006j7-00 for guile-devel@gnu.org; Fri, 28 Feb 2003 17:47:26 -0500 Original-Received: from sunny.pacific.net.au ([203.2.228.40]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18otHS-0006e8-00 for guile-devel@gnu.org; Fri, 28 Feb 2003 17:47:03 -0500 Original-Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id h1SMkw82018016 for ; Sat, 1 Mar 2003 09:46:58 +1100 (EST) Original-Received: from localhost (ppp25.dyn228.pacific.net.au [203.143.228.25]) by wisma.pacific.net.au with ESMTP id JAA04641 for ; Sat, 1 Mar 2003 09:46:56 +1100 (EST) Original-Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 18otGS-0000UM-00; Sat, 01 Mar 2003 08:46:00 +1000 Original-To: guile-devel@gnu.org In-Reply-To: <873cmaseb8.fsf@raven.i.defaultvalue.org> (Rob Browning's message of "Wed, 26 Feb 2003 19:27:39 -0600") User-Agent: Gnus/5.090013 (Oort Gnus v0.13) Emacs/21.2 (i386-pc-linux-gnu) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2011 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2011 Rob Browning writes: > > The fact that all the values are so close makes me wonder if much of > the cost is just interpreter related. Perhaps bigger numbers would show up better. The advantages of gmp normally increase with increasing size. > Note that I left the same algorithm as before for the inum case. mpn_gcd_1 would be a possibility for that, to save some code. Probably no great difference in speed normally, though gmp does have some nice assembler versions for K6 and Athlon. > } else if (SCM_BIGP (y)) { > SCM result = scm_i_mkbig (); > SCM mx = scm_i_mkbig (); > mpz_set_si(SCM_I_BIG_MPZ (mx), SCM_INUM (x)); > scm_remember_upto_here_1 (x); > mpz_gcd(SCM_I_BIG_MPZ (result), SCM_I_BIG_MPZ (mx), SCM_I_BIG_MPZ (y)); Could probably use mpz_gcd_ui instead of converting x to an mpz. Unless I've missed something basic and a conversion should be done. In which case maybe the result variable could be pressed into service, convert into that and call mpz_gcd(result,result,y). _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel