From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Rob Browning Newsgroups: gmane.lisp.guile.devel Subject: GMP code committed -- watch for bugs. Date: Fri, 04 Apr 2003 16:34:50 -0600 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87he9dhoxh.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 1049496126 5713 80.91.224.249 (4 Apr 2003 22:42:06 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 4 Apr 2003 22:42:06 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Apr 05 00:42:05 2003 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 191Zs8-0001Qz-00 for ; Sat, 05 Apr 2003 00:41:20 +0200 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 191ZoQ-0003Jv-0B for guile-devel@m.gmane.org; Fri, 04 Apr 2003 17:37:30 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 191ZmR-0002az-00 for guile-devel@gnu.org; Fri, 04 Apr 2003 17:35:27 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 191Zlv-0000ub-00 for guile-devel@gnu.org; Fri, 04 Apr 2003 17:35:00 -0500 Original-Received: from dsl093-098-016.wdc1.dsl.speakeasy.net ([66.93.98.16] helo=defaultvalue.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 191Zlt-0000kH-00 for guile-devel@gnu.org; Fri, 04 Apr 2003 17:34:53 -0500 Original-Received: from raven.i.defaultvalue.org (raven.i.defaultvalue.org [192.168.1.7]) by defaultvalue.org (Postfix) with ESMTP id 429338D3 for ; Fri, 4 Apr 2003 16:34:51 -0600 (CST) Original-Received: by raven.i.defaultvalue.org (Postfix, from userid 1000) id 042F6E9844; Fri, 4 Apr 2003 16:34:50 -0600 (CST) Original-To: guile-devel@gnu.org User-Agent: Gnus/5.090008 (Oort Gnus v0.08) 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:2127 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2127 I've just committed the code that switches us over to full-time bignums using GMP. I've tagged before and after with rlb-pre-gmp and rlb-post-gmp. (Marius: we'll need to finish switching to LGPL now. I put a note in LICENSE for now. I suppose we'll need to exchange COPYING for COPYING.LIB. However if automake throws a fit and/or keeps putting COPYING back, we might just leave it. LICENSE is the critical file.) (Mikael: if you get a second, could you look at random.c and make sure you don't see any obvious mistakes. One thing in particular -- could you look at the FIXME there -- if there's a chance that a random bignum could end up with enough leading zeroes to place it in fixnum territory, then we need to return scm_i_normbig (result), but I wanted to check with you first. Returning a bignum with a value in fixnum range would violate an assumption made by other guile numerical code.) There may well be bugs -- in addition to numbers.c, the other main things to check (if you're motiviated) are random.c, socket.c, and num2integral.c. If/when you do find a bug, could you also try to add a suitable test (if possible) to test-suite/tests/numbers.test or similar so we don't regress in the future? Overall the performance in my really simple tests on ~256-bit bignums suggests this is code faster than the old code, but less space efficient for smaller values. To some extent the conversion in numbers.c has been fairly straightforward. There may still be places (i.e. perhaps have integer-expt use mpz_pow or mpf_pow_ui when the types are right) where special casing with GMP operations could help, but it'll probably take some good benchmarking to know for sure. -- Rob Browning rlb @defaultvalue.org, @linuxdevel.com, and @debian.org Previously @cs.utexas.edu GPG starting 2002-11-03 = 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel