From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.algonet.se!algonet!newsfeed1.bredband.com!bredband!uio.no!nntp.uio.no!ifi.uio.no!not-for-mail From: Erik Naggum Newsgroups: comp.lang.lisp Subject: Re: compiled code Date: 12 Sep 2002 02:26:48 +0000 Organization: Naggum Software, Oslo, Norway Lines: 22 Message-ID: <3240786408336302@naggum.no> References: <3d7edbb2.2307456@News.CIS.DFN.DE> <41y80cz9s.fsf@beta.franz.com> <20020911132946.J23781@lain.res.cmu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: maud.ifi.uio.no 1031797609 9863 129.240.64.16 (12 Sep 2002 02:26:49 GMT) X-Complaints-To: abuse@ifi.uio.no NNTP-Posting-Date: 12 Sep 2002 02:26:49 GMT Mail-Copies-To: never User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.lisp:40388 * Matthew Danish | Very nice output =) But how does it know that the result is a fixnum? Allegro CL has a compiler optimization switch that makes declared fixnums remain fixnums. It defaults to true only when speed is 3 and safety 0. If you turn it off, the same Common Lisp code produces more machine code: 0: c1 f8 02 sarl eax,$2 3: c1 fa 02 sarl edx,$2 6: 03 c2 addl eax,edx 8: ff a7 87 00 jmp *[edi+135] ; sys::fixnum-or-bignum 00 00 The shifts convert from the fixnum representation (two type tag bits) to the machine integer and the tail-called function will shift the sum back if there is space or cons a bignum if not. -- Erik Naggum, Oslo, Norway Act from reason, and failure makes you rethink and study harder. Act from faith, and failure makes you blame someone and push harder.