>>>>> "Thomas" == Thomas Fischbacher <[EMAIL PROTECTED]> writes:

    Thomas> On Fri, 19 Mar 2004, David Hanley wrote:

    >> You can make your own primitives fairly easily.  
    >> 
    >> (defmacro f+(n1 n2)`(the fixnum (+ (the fixnum ,n1)
    >> (the fixnum ,n2))))
    >> 
    >> Now you can use (f+ 1 2) 

    Thomas> Better idea:

[snip]

Listen to what Alexey said.  If you lie to the compiler, which are you
doing, the compiler can and will bite you.

One of the ansi-tests triggers a bug in the compiler when doing
multipler-recoding, which tries to lie to the compiler.  This causes
the compiler to generate bogus code and causes segfaults.

If you really MUST have fast fixnum, here is one way to do it in
cmucl.

(in-package :vm)
(defknown fixnum+ (fixnum fixnum)
  fixnum
  (movable foldable flushable))

(define-vop (fixnum-add fast-+/fixnum=>fixnum)
  (:translate fixnum+))

(defun fixnum+ (x y)
  (declare (fixnum x y))
  (fixnum+ x y))

Then

(vm:fixnum+ most-positive-fixnum 1) => -536870912

Ray

-- 
Ericsson may automatically add a disclaimer.  Sorry, it's beyond my
control.


 

This communication is confidential and intended solely for the addressee(s). Any 
unauthorized review, use, disclosure or distribution is prohibited. If you believe 
this message has been sent to you in error, please notify the sender by replying to 
this transmission and delete the message without disclosing it. Thank you.

E-mail including attachments is susceptible to data corruption, interruption, 
unauthorized amendment, tampering and viruses, and we only send and receive e-mails on 
the basis that we are not liable for any such corruption, interception, amendment, 
tampering or viruses or any consequences thereof.

Reply via email to