On 8708 day of my life Jonathan Bailleul wrote:
>> Wrap (EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE) ...)
>> around DEFKNOWN and DEFINE-VOP. If it does not help, replace DEFUN
>> with (SETF FDEFINITION).
>
> Sorry to rush in the topic, but can someone give me exact code for this
> module? (especially concerning the eval-when)
> I would like to see it running and then look in the documentation what
> means what (eval-when, defknown, define-vop... )

(EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE)
  (vm::defknown fixnum+ (fixnum fixnum)
    fixnum
    (vm::movable vm::foldable vm::flushable))

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

  (vm::defknown fixnum* (fixnum fixnum)
    fixnum
    (vm::movable vm::foldable vm::flushable))

  (vm::define-vop (fixnum-mul vm::fast-*/fixnum=>fixnum)
      (:translate fixnum*))
  )

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

(defun fixnum* (x y)
  (declare (type fixnum x y))
  (fixnum* x y))


-- 
Ivan Boldyrev

       Assembly of a Japanese bicycle requires greatest peace of spirit.


Reply via email to