gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gcl-devel] Inefficient unsigned 32-bit arithmetic?


From: Camm Maguire
Subject: Re: [Gcl-devel] Inefficient unsigned 32-bit arithmetic?
Date: 23 Jun 2004 18:00:02 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings, and thanks for your post bringing this up!  (But the
formatting ... :-()

Broadly, of course, the issue is that unsigned 32 bit integer
arithmetic cannot be handled in a C variable declared long (equivalent
to fixnum).  We would have to extend the output C variable
possibilities to unsigned long, and (hopefully) long long and unsigned
long long to handle this optimally.  On this point, we also need to
make fixnums twice as large on 64bit -- right now they have their same
value as 32bit, though of course the underlying C arithmetic is twice as
large.  All of this is not conceptually difficult, but will require a
lot of testing, and so cannot be done officially at least
immediately.  

If you are interested at trying your hand at a patch, the key place
where this is set is in gcl_cmptype.lsp:

... 
             (integer
                (if (si::sub-interval-p (cdr type)
                                        (list most-negative-fixnum
                                              most-positive-fixnum))
                    'fixnum
                    'integer))
 ...

Regarding efficiency in general, the code you posted can be
significantly improved were you to proclaim the functions.  Check out
the documentation for compiler::emit-fn, and
compiler::make-all-proclaims. 

Please keep us posted.

Take care,

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]