-
Notifications
You must be signed in to change notification settings - Fork 152
inlined sum, sumabs2, mean, and similar? #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In this case, the optimizer actually seems to be doing very well at turning the generic Base code into something efficient: julia> using StaticArrays
julia> @code_native sum(SVector(1,2,3))
.text
Filename: reduce.jl
pushq %rbp
movq %rsp, %rbp
Source line: 108
movq 8(%rdi), %rax
addq (%rdi), %rax
addq 16(%rdi), %rax
Source line: 229
popq %rbp
retq
nopw %cs:(%rax,%rax) I get similar results for With the current compiler and standard library, it's hard to know what to do about |
Ah wait. @andyferris has implemented Fair enough to have these |
Yes, I've been aiming for some compatibility for Also note that just because Steven, do you think adding |
I've done all the ones I can think of... I'll close this but feel free to reopen with further requests. |
It seems like it would be worthwhile to inline common reduction operations for small vectors rather than calling the generic Base reduce code?
The text was updated successfully, but these errors were encountered: