-
Notifications
You must be signed in to change notification settings - Fork 19
SIMD spectralnorm #77
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
base: master
Are you sure you want to change the base?
Conversation
@@ -1,6 +1,6 @@ | |||
SOURCES = $(wildcard src/*.rs) | |||
RUSTC ?= rustc | |||
RUSTC_FLAGS ?= -C opt-level=3 -C target-cpu=core2 -C lto | |||
RUSTC_FLAGS ?= -C panic=abort -C opt-level=3 -C target-cpu=core2 -C lto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll ask for this modification?
} | ||
fn a(i: [usize; 2], j: [usize; 2]) -> F64x2 { | ||
F64x2::new(((i[0] + j[0]) * (i[0] + j[0] + 1) / 2 + i[0] + 1) as f64, | ||
((i[1] + j[1]) * (i[1] + j[1] + 1) / 2 + i[1] + 1) as f64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No SIMD here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't want to SIMDify fn a()
, that's good for me.
Ah, I completely overlooked this. |
This replaces the autovectorized code with explicit SIMD instructions and inlines the former
div_and_add
function. On my machine, the difference is negligible, but I suspect that skylake has better branch prediction than the old Core 2, so here goes nothing...