.global sum sum: // Can we return 2 and a half? // movsd two_and_a_half(%rip), %xmm0 // mov $2, %rax // cvtsi2sd %rax, %xmm0 // Parameter in %rdi // Count will be in %xmm1 mov $0, %rax cvtsi2sd %rax, %xmm0 cvtsi2sd %rax, %xmm2 top: movsd (%rdi), %xmm1 add $8, %rdi add %xmm1, %xmm0 comisd %xmm2, %xmm1 jne top ret two_and_a_half: .double 2.5