Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Dot product

Name: Anonymous 2011-08-02 14:18

Single precision floating point.
System V AMD64 ABI convention.


sses_dot:
    movaps xmm0, [rdi]
    mulps xmm0, [rsi]
    haddps xmm0, xmm0
    haddps xmm0, xmm0
    ret

Name: Anonymous 2011-08-02 17:12

>>3


(define (do-product v w)
  (letrec [(helper (lambda (v w sum)
                     (if (or (null? v) (null? w))
                       sum
                       (helper (cdr v)
                               (cdr w)
                               (+ (* (car v) (car w)) sum)))))]
    (helper v w 0)))

                                  
                      
[/code]

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List