[gambit-list] newbie: bitwise and arithmetic runtime speed for u64

Lucier, Bradley J bradley.j.lucier.1 at purdue.edu
Sun Apr 26 19:14:09 EDT 2020


> On Apr 26, 2020, at 6:20 PM, Marc Feeley <feeley at iro.umontreal.ca> wrote:
> 
> (c-declare "#define ELEM0(u64vect) ___BODY_AS(u64vect,___tSUBTYPED)[0]")
> 
> (define-macro (u64-xor! v1 v2) ;; v1[0] = v1[0] ^ v2[0]
>  `(##c-code "ELEM0(___ARG1) ^= ELEM0(___ARG2);" v1 v2))

He originally had similar code:

; (define u64c-and
; (c-lambda (unsigned-int64 unsigned-int64)
; unsigned-int64 "___return(___arg1 & ___arg2);”))

Would inlining the code as you did give better performance instead of using a c-lambda?

Brad


More information about the Gambit-list mailing list