Ivan Boldyrev wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 8689 day of my life Alexey Dejneka wrote:
>
>>>On 8689 day of my life Raymond Toy wrote:
>>>It's exactly what I want! But when I try (fixnum+ anything1
>>>anything2), it just loops and cons a memory... I can't fix it without
>>>your help, because I don't understand anyting here :(
>>
>>Wrap (EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE) ...)
>>around DEFKNOWN and DEFINE-VOP.
>
>
> Thanks to you and Raymond!!! It works perfectly! (BTW, I failed
> before because I just tried to type the code in REPL).
Oops. I did test it, but not in a file to be compiled. I just typed it
into some cmucl file, and used xemacs and slime to compile them one at a
time.
>
> CMU CL has non-standard operations like kernel:32bit-logical-xor.
> What about creating functions for 32-bit or fixnum arithmetics? I
> would even try to participate :)
You should be able to use the standard Lisp functions for these, I
think. For example,
(defun foo (x y) (declare (fixnum x y)) (logxor x y))
produces the following disassembly on sparc:
D8: ADD -18, %CODE
DC: ADD %CFP, 32, %CSP
E0: XOR %A1, %A0 ; %A0 = X
; %A1 = Y
E4: MOV %CFP, %CSP ; [:BLOCK-START]
E8: MOV %OCFP, %CFP
EC: J %LRA+5
F0: MOV %LRA, %CODE
F4: ILLTRAP 0
I think that's what you want.
Ray