From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.bugs Subject: bug#14916: Fixnum procedures can be made to return non-fixnums Date: Fri, 16 Aug 2013 23:32:32 -0400 Message-ID: <87ioz5gffz.fsf@tines.lan> References: <8738r9ai62.fsf@industria.weinholt.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1376710402 5081 80.91.229.3 (17 Aug 2013 03:33:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 Aug 2013 03:33:22 +0000 (UTC) Cc: 14916@debbugs.gnu.org To: =?UTF-8?Q?G=C3=B6ran?= Weinholt Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Aug 17 05:33:21 2013 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VAXGR-0000FF-E8 for guile-bugs@m.gmane.org; Sat, 17 Aug 2013 05:33:19 +0200 Original-Received: from localhost ([::1]:34275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAXGQ-0007xo-RU for guile-bugs@m.gmane.org; Fri, 16 Aug 2013 23:33:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAXGG-0007xX-RR for bug-guile@gnu.org; Fri, 16 Aug 2013 23:33:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VAXGA-0002lE-RR for bug-guile@gnu.org; Fri, 16 Aug 2013 23:33:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41409) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAXGA-0002lA-Op for bug-guile@gnu.org; Fri, 16 Aug 2013 23:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VAXGA-0000Ce-7w for bug-guile@gnu.org; Fri, 16 Aug 2013 23:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 17 Aug 2013 03:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14916 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 14916-submit@debbugs.gnu.org id=B14916.1376710369759 (code B ref 14916); Sat, 17 Aug 2013 03:33:02 +0000 Original-Received: (at 14916) by debbugs.gnu.org; 17 Aug 2013 03:32:49 +0000 Original-Received: from localhost ([127.0.0.1]:35725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VAXFw-0000C9-8E for submit@debbugs.gnu.org; Fri, 16 Aug 2013 23:32:49 -0400 Original-Received: from world.peace.net ([96.39.62.75]:60020 ident=hope3) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VAXFt-0000By-Rx for 14916@debbugs.gnu.org; Fri, 16 Aug 2013 23:32:46 -0400 Original-Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1VAXFn-00011q-IZ; Fri, 16 Aug 2013 23:32:39 -0400 In-Reply-To: <8738r9ai62.fsf@industria.weinholt.se> ("=?UTF-8?Q?G=C3=B6ran?= Weinholt"'s message of "Sat, 20 Jul 2013 07:56:21 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7255 Archived-At: G=C3=B6ran Weinholt writes: > the fxdiv procedure from (rnrs) fails to check that its result is > representable as a fixnum: > > scheme@(guile-user)> (import (rnrs)) > scheme@(guile-user)> (fxdiv (least-fixnum) -1) > $1 =3D 2305843009213693952 > > It should raise an &implementation-restriction. Hmm. Currently, our fixnum and flonum operations are implemented in terms of the generic operations, with added checks. Whereas the most important generic arithmetic operations compile to VM instructions, the fixnum and flonum operations compile into procedure calls to scheme code that performs the checks and then uses the generic ops. Needless to say, this is terribly slow. I'm reluctant to make that code any slower by adding more checks. However, in the coming months I intend to reimplement the fixnum and flonum operations, using dedicated instructions in the new RTL VM which will be the basis of Guile 2.2. It would be possible to backport some of this to Guile 2.0 as well, but I'm not sure it's worth the effort. What do you think? Mark